Copy disabled (too large)
Download .txt
Showing preview only (11,077K chars total). Download the full file to get everything.
Repository: snipsco/tract
Branch: main
Commit: d5e7f043c6d3
Files: 1571
Total size: 10.3 MB
Directory structure:
gitextract_37zz2va9/
├── .all_crates.sh
├── .change_crate_dep.sh
├── .clang-format
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ ├── asan.yml
│ ├── binaries.yml
│ ├── cost_model.yml
│ ├── crates.yml
│ ├── cross-platform.yml
│ ├── examples.yml
│ ├── full.yml
│ ├── large_models.yml
│ ├── pydoc.yml
│ ├── release.yml
│ ├── tract-ci-bench.yml
│ ├── wheels.yml
│ └── windows.yml
├── .gitignore
├── .travis/
│ ├── README.md
│ ├── android-ndk.sh
│ ├── asan.sh
│ ├── bundle-entrypoint.sh
│ ├── cache_file.sh
│ ├── cargo-deny-check.sh
│ ├── ci-system-setup.sh
│ ├── cli-tests.sh
│ ├── cost_model_task_build.sh
│ ├── cross.sh
│ ├── debug-tests.sh
│ ├── docker-debian-stretch/
│ │ ├── Dockerfile
│ │ └── sources.list
│ ├── examples.sh
│ ├── llm-expectations-541
│ ├── make_bundle.sh
│ ├── minion.sh
│ ├── minionrc
│ ├── native.sh
│ ├── onnx-tests.sh
│ ├── regular-tests.sh
│ ├── run-bundle.sh
│ ├── run_all.sh
│ ├── setup-sccache.sh
│ ├── test-harness.sh
│ ├── test-llm.sh
│ ├── test-published-crates.sh
│ ├── test-rt.sh
│ ├── tf.sh
│ ├── tflite/
│ │ ├── Dockerfile.tensorflow-aarch64
│ │ ├── Dockerfile.tensorflow-official-rpi
│ │ ├── Dockerfile.tensorflow-rpitools
│ │ ├── build_tflite_aarch64.sh
│ │ ├── build_tflite_raspbian.sh
│ │ ├── convert_all.sh
│ │ ├── linux_makefile.inc
│ │ └── run_all.sh
│ ├── tflite.sh
│ └── travis.sh
├── .travis.yml
├── .vim/
│ └── coc-settings.json
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── api/
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── c/
│ │ ├── .gitignore
│ │ ├── Makefile
│ │ ├── grace_hopper_3_224_224.f32.raw
│ │ └── mobilenet.c
│ ├── ffi/
│ │ ├── Cargo.toml
│ │ ├── cbindgen.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── generate-tract-h.sh
│ ├── proxy/
│ │ ├── Cargo.toml
│ │ ├── LICENSE
│ │ ├── LICENSE-APACHE
│ │ ├── LICENSE-MIT
│ │ ├── ci.sh
│ │ ├── src/
│ │ │ └── lib.rs
│ │ ├── sys/
│ │ │ ├── Cargo.toml
│ │ │ ├── build.rs
│ │ │ ├── src/
│ │ │ │ └── lib.rs
│ │ │ └── tract.h
│ │ └── tests/
│ │ └── mobilenet.rs
│ ├── py/
│ │ ├── .gitignore
│ │ ├── MANIFEST.in
│ │ ├── _static/
│ │ │ ├── redirect-index.html
│ │ │ └── version-switcher.js
│ │ ├── conf.py
│ │ ├── docs/
│ │ │ ├── fact.md
│ │ │ ├── index.md
│ │ │ ├── inference_model.md
│ │ │ ├── model.md
│ │ │ ├── nnef.md
│ │ │ ├── onnx.md
│ │ │ ├── runnable.md
│ │ │ └── tensor.md
│ │ ├── grace_hopper_1x3x224x244.npy
│ │ ├── pyproject.toml
│ │ ├── requirements-docs.txt
│ │ ├── requirements.txt
│ │ ├── setup.py
│ │ ├── tests/
│ │ │ └── mobilenet_onnx_test.py
│ │ └── tract/
│ │ ├── __init__.py
│ │ ├── bindings.py
│ │ ├── dim.py
│ │ ├── fact.py
│ │ ├── inference_model.py
│ │ ├── model.py
│ │ ├── nnef.py
│ │ ├── onnx.py
│ │ ├── runnable.py
│ │ ├── runtime.py
│ │ ├── state.py
│ │ ├── tensor.py
│ │ └── transform.py
│ ├── rs/
│ │ ├── Cargo.toml
│ │ ├── LICENSE
│ │ ├── LICENSE-APACHE
│ │ ├── LICENSE-MIT
│ │ ├── src/
│ │ │ └── lib.rs
│ │ └── tests/
│ │ └── mobilenet.rs
│ ├── src/
│ │ ├── lib.rs
│ │ ├── macros.rs
│ │ └── transform.rs
│ └── tests/
│ ├── grace_hopper_3_224_224.f32.raw
│ └── mobilenet/
│ └── mod.rs
├── ci/
│ └── tract-ci-minion/
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── minion.toml.example
│ └── src/
│ └── main.rs
├── cli/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── src/
│ ├── bench.rs
│ ├── compare.rs
│ ├── cost.rs
│ ├── dump.rs
│ ├── hwbench.rs
│ ├── llm.rs
│ ├── macros.rs
│ ├── main.rs
│ ├── memory_arena.rs
│ ├── model.rs
│ ├── params.rs
│ ├── plan_options.rs
│ ├── run.rs
│ ├── runtimes.rs
│ ├── tensor.rs
│ └── utils.rs
├── core/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── src/
│ │ ├── axes/
│ │ │ ├── mapping.rs
│ │ │ ├── mod.rs
│ │ │ └── model.rs
│ │ ├── broadcast.rs
│ │ ├── floats.rs
│ │ ├── framework.rs
│ │ ├── late_bind.rs
│ │ ├── lib.rs
│ │ ├── macros.rs
│ │ ├── model/
│ │ │ ├── fact.rs
│ │ │ ├── graph.rs
│ │ │ ├── helpers.rs
│ │ │ ├── memory.rs
│ │ │ ├── mod.rs
│ │ │ ├── node.rs
│ │ │ ├── order.rs
│ │ │ ├── patch.rs
│ │ │ ├── rewriter.rs
│ │ │ ├── translator.rs
│ │ │ └── typed.rs
│ │ ├── ops/
│ │ │ ├── array/
│ │ │ │ ├── broadcast.rs
│ │ │ │ ├── concat.rs
│ │ │ │ ├── dyn_slice.rs
│ │ │ │ ├── gather.rs
│ │ │ │ ├── gather_elements.rs
│ │ │ │ ├── gather_nd.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── one_hot.rs
│ │ │ │ ├── pad.rs
│ │ │ │ ├── range.rs
│ │ │ │ ├── reshape.rs
│ │ │ │ ├── scatter_elements.rs
│ │ │ │ ├── scatter_nd.rs
│ │ │ │ ├── slice.rs
│ │ │ │ ├── strided_slice.rs
│ │ │ │ ├── tile.rs
│ │ │ │ ├── topk.rs
│ │ │ │ └── trilu.rs
│ │ │ ├── binary.rs
│ │ │ ├── cast.rs
│ │ │ ├── change_axes.rs
│ │ │ ├── cnn/
│ │ │ │ ├── conv/
│ │ │ │ │ ├── block_quant.rs
│ │ │ │ │ ├── conv.rs
│ │ │ │ │ ├── depth_wise.rs
│ │ │ │ │ ├── im2col.rs
│ │ │ │ │ ├── lazy_im2col.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── q_sum_b.rs
│ │ │ │ ├── deconv/
│ │ │ │ │ ├── deconv.rs
│ │ │ │ │ ├── deconv_sum.rs
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── maxpool.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── padding.rs
│ │ │ │ ├── patch_axis.rs
│ │ │ │ ├── patches.rs
│ │ │ │ ├── pools.rs
│ │ │ │ └── sumpool.rs
│ │ │ ├── downsample/
│ │ │ │ ├── array.rs
│ │ │ │ ├── conv.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── scan.rs
│ │ │ ├── dummy.rs
│ │ │ ├── einsum/
│ │ │ │ ├── as_blas.rs
│ │ │ │ ├── einsum_matmul.rs
│ │ │ │ ├── eval.rs
│ │ │ │ ├── kernel_selection.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── prefix_matmul.rs
│ │ │ │ └── proptest.rs
│ │ │ ├── element_wise.rs
│ │ │ ├── fft.rs
│ │ │ ├── identity.rs
│ │ │ ├── konst.rs
│ │ │ ├── logic/
│ │ │ │ ├── comparison.rs
│ │ │ │ └── ite.rs
│ │ │ ├── logic.rs
│ │ │ ├── macros.rs
│ │ │ ├── math/
│ │ │ │ ├── complex.rs
│ │ │ │ └── mod.rs
│ │ │ ├── matmul/
│ │ │ │ ├── de_block_quant.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── optimized.rs
│ │ │ │ ├── pack.rs
│ │ │ │ └── quant.rs
│ │ │ ├── memory/
│ │ │ │ ├── force_eval.rs
│ │ │ │ ├── load.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── store.rs
│ │ │ ├── mod.rs
│ │ │ ├── nn/
│ │ │ │ ├── data_formats.rs
│ │ │ │ ├── gelu_approximate.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── reduce.rs
│ │ │ │ ├── rms_norm.rs
│ │ │ │ ├── silu.rs
│ │ │ │ └── softmax/
│ │ │ │ ├── fixedpoint.rs
│ │ │ │ ├── math.rs
│ │ │ │ └── mod.rs
│ │ │ ├── quant.rs
│ │ │ ├── scan/
│ │ │ │ ├── decluttered.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── optimized.rs
│ │ │ ├── source.rs
│ │ │ ├── submodel.rs
│ │ │ └── unimpl.rs
│ │ ├── optim/
│ │ │ ├── change_axes.rs
│ │ │ ├── concat_then_einsum.rs
│ │ │ ├── mod.rs
│ │ │ ├── op_optim.rs
│ │ │ ├── prop_const.rs
│ │ │ ├── propagate_roi.rs
│ │ │ ├── push_split_down.rs
│ │ │ ├── slice.rs
│ │ │ └── uniform_mask.rs
│ │ ├── plan.rs
│ │ ├── runtime.rs
│ │ ├── transform.rs
│ │ └── value.rs
│ └── test_data/
│ └── test_data.cfg
├── cuda/
│ ├── Cargo.toml
│ ├── benches/
│ │ └── cuda_flash.rs
│ └── src/
│ ├── context.rs
│ ├── kernels/
│ │ ├── array/
│ │ │ ├── cast.rs
│ │ │ ├── copy.rs
│ │ │ ├── dispatch.rs
│ │ │ ├── mod.rs
│ │ │ └── rotate_half.rs
│ │ ├── binary.rs
│ │ ├── conv.rs
│ │ ├── conv_cudnn.rs
│ │ ├── cu/
│ │ │ ├── array.cu
│ │ │ ├── binary.cu
│ │ │ ├── cnn.cu
│ │ │ ├── common.cuh
│ │ │ ├── element_wise.cu
│ │ │ ├── flash_attn.cu
│ │ │ ├── ggml_flash_attn.cu
│ │ │ ├── mm_mv.cu
│ │ │ ├── mm_mv_q.cu
│ │ │ ├── nn.cu
│ │ │ └── quantize.cu
│ │ ├── element_wise.rs
│ │ ├── flash_attn.rs
│ │ ├── ggml_flash_attn.rs
│ │ ├── iff.rs
│ │ ├── launch_args.rs
│ │ ├── matmul/
│ │ │ ├── mod.rs
│ │ │ └── quant_act_q81.rs
│ │ ├── mod.rs
│ │ ├── nn/
│ │ │ ├── apply_rope.rs
│ │ │ ├── gelu_approximate.rs
│ │ │ ├── leaky_relu.rs
│ │ │ ├── mod.rs
│ │ │ ├── reduce.rs
│ │ │ ├── rms_norm.rs
│ │ │ ├── scaled_masked_softmax.rs
│ │ │ └── softmax.rs
│ │ └── utils.rs
│ ├── lib.rs
│ ├── ops/
│ │ ├── conv.rs
│ │ ├── flash_attn.rs
│ │ ├── fused_axis_op.rs
│ │ ├── gemm.rs
│ │ ├── ggml_flash_attn.rs
│ │ ├── iff.rs
│ │ ├── mod.rs
│ │ └── quant_q81.rs
│ ├── rewrite_rules/
│ │ ├── add_matmul_broadcast.rs
│ │ ├── fuse_axis_op.rs
│ │ ├── mod.rs
│ │ ├── pad_q40_weights.rs
│ │ └── untranspose_matmul_output.rs
│ ├── tensor.rs
│ ├── transform.rs
│ └── utils.rs
├── data/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── benches/
│ │ ├── stack_tensors.rs
│ │ └── tensor_from_datum.rs
│ └── src/
│ ├── blob.rs
│ ├── datum.rs
│ ├── dim/
│ │ ├── assertion.rs
│ │ ├── mod.rs
│ │ ├── parse.rs
│ │ ├── resolve.rs
│ │ ├── sym.rs
│ │ └── tree.rs
│ ├── exotic.rs
│ ├── lib.rs
│ ├── macros.rs
│ ├── scatter.rs
│ ├── tensor/
│ │ ├── litteral.rs
│ │ ├── plain_view.rs
│ │ ├── storage.rs
│ │ └── view.rs
│ └── tensor.rs
├── deny.toml
├── doc/
│ ├── README.md
│ ├── cli-recipe.md
│ ├── graph.md
│ ├── intro.md
│ ├── kernel-notes.md
│ ├── nnef/
│ │ ├── tract-core.nnef
│ │ ├── tract-onnx.nnef
│ │ ├── tract-pulse.nnef
│ │ └── tract-resource.nnef
│ └── op.md
├── examples/
│ ├── .gitignore
│ ├── causal_llm/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ ├── scripts/
│ │ │ └── generate_ci_llm_assets.sh
│ │ └── src/
│ │ ├── bin/
│ │ │ ├── client.rs
│ │ │ ├── common/
│ │ │ │ └── mod.rs
│ │ │ ├── complete.rs
│ │ │ └── serve.rs
│ │ └── lib.rs
│ ├── face_detection_yolov8onnx_example/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ └── src/
│ │ └── main.rs
│ ├── face_similarity_arcface_onnx/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ └── src/
│ │ ├── arc_face.rs
│ │ ├── main.rs
│ │ └── yolo_face.rs
│ ├── keras-tract-tf2/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh.nope
│ │ ├── example.py
│ │ ├── io.npz
│ │ ├── requirements.txt
│ │ └── src/
│ │ └── main.rs
│ ├── nemo-nemotron-asr/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── ci.sh
│ │ ├── nemotron.py
│ │ └── src/
│ │ └── main.rs
│ ├── nemo-parakeet-asr/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── ci.sh
│ │ ├── parakeet.py
│ │ └── src/
│ │ └── main.rs
│ ├── nnef-dump-mobilenet-v2/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ └── src/
│ │ └── main.rs
│ ├── nnef-mobilenet-v2/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── ci.sh
│ │ ├── imagenet_slim_labels.txt
│ │ └── src/
│ │ └── main.rs
│ ├── nnef-mobilenet-v2-api/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── ci.sh
│ │ ├── imagenet_slim_labels.txt
│ │ └── src/
│ │ └── main.rs
│ ├── onnx-mobilenet-v2/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ ├── imagenet_slim_labels.txt
│ │ └── src/
│ │ ├── bin/
│ │ │ └── dyn-shape.rs
│ │ └── main.rs
│ ├── pytorch-albert-v2/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ ├── export.py
│ │ └── src/
│ │ └── main.rs
│ ├── pytorch-resnet/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ ├── export.py
│ │ ├── requirements.txt
│ │ └── src/
│ │ └── main.rs
│ ├── stable-diffusion/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci-gpu.sh
│ │ ├── export.py
│ │ ├── reference.py
│ │ └── src/
│ │ └── main.rs
│ ├── stable-diffusion-3/
│ │ ├── Cargo.toml
│ │ ├── export.py
│ │ ├── reference.py
│ │ ├── runme.sh
│ │ └── src/
│ │ └── main.rs
│ ├── stable-diffusion-xl/
│ │ ├── Cargo.toml
│ │ ├── ci-gpu.sh
│ │ ├── export.py
│ │ ├── reference.py
│ │ └── src/
│ │ └── main.rs
│ ├── tensorflow-mobilenet-v2/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── ci.sh
│ │ ├── imagenet_slim_labels.txt
│ │ └── src/
│ │ └── main.rs
│ └── tflite-mobilenet-v3/
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── README.md
│ ├── ci.sh
│ ├── imagenet_slim_labels.txt
│ └── src/
│ └── main.rs
├── extra/
│ ├── Cargo.toml
│ └── src/
│ ├── exp_unit_norm.rs
│ └── lib.rs
├── gpu/
│ ├── Cargo.toml
│ └── src/
│ ├── device.rs
│ ├── fact.rs
│ ├── lib.rs
│ ├── memory/
│ │ ├── mod.rs
│ │ ├── pool.rs
│ │ └── schema.rs
│ ├── ops/
│ │ ├── RECIPE.md
│ │ ├── apply_rope.rs
│ │ ├── binary.rs
│ │ ├── broadcast.rs
│ │ ├── cast.rs
│ │ ├── change_axes.rs
│ │ ├── concat.rs
│ │ ├── copy_based.rs
│ │ ├── dyn_kv_cache.rs
│ │ ├── element_wise.rs
│ │ ├── gelu_approximate.rs
│ │ ├── iff.rs
│ │ ├── leaky_relu.rs
│ │ ├── mod.rs
│ │ ├── pulse.rs
│ │ ├── reduce.rs
│ │ ├── rms_norm.rs
│ │ ├── rotate_half.rs
│ │ ├── scaled_masked_softmax.rs
│ │ ├── slice.rs
│ │ └── softmax.rs
│ ├── rewrite_rules/
│ │ ├── mod.rs
│ │ ├── rewire_sdpa.rs
│ │ ├── rewire_syncs.rs
│ │ └── rms_norm.rs
│ ├── session_handler.rs
│ ├── sync.rs
│ ├── tensor/
│ │ ├── arena_view.rs
│ │ ├── mod.rs
│ │ └── owned.rs
│ └── utils.rs
├── harness/
│ ├── core-proptest-pulse/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── conv_plus_conv.rs
│ │ ├── deconv.rs
│ │ ├── delay_plus_downsample.rs
│ │ ├── delay_plus_pool.rs
│ │ ├── einsum.rs
│ │ ├── lib.rs
│ │ └── pad_plus_conv.rs
│ ├── nemotron-speech-streaming-en-0.6b/
│ │ └── ci.sh
│ ├── nnef-inceptionv3/
│ │ ├── Cargo.toml
│ │ ├── download.sh
│ │ └── src/
│ │ └── lib.rs
│ ├── nnef-test-cases/
│ │ ├── .gitignore
│ │ ├── conv-bias/
│ │ │ ├── expected
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── conv-q40/
│ │ │ ├── conv2d/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_base_kernel1/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_base_kernel3/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_base_kernel9/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_dilation2/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_dilation4/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_dilation8/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_groups2/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_groups4/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_insize128/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_insize64/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── conv_stride2/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ └── conv_stride3/
│ │ │ ├── io.npz
│ │ │ ├── model.nnef.tgz
│ │ │ └── runme.sh
│ │ ├── conv-with-batch/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── debox/
│ │ │ ├── debox_base/
│ │ │ │ ├── graph.nnef
│ │ │ │ ├── io.npz
│ │ │ │ └── runme.sh
│ │ │ └── debox_high_dim/
│ │ │ ├── graph.nnef
│ │ │ ├── io.npz
│ │ │ └── runme.sh
│ │ ├── dyn_slice/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── fixed_roll/
│ │ │ ├── graph.nnef
│ │ │ ├── io.npz
│ │ │ └── runme.sh
│ │ ├── memory-arena/
│ │ │ ├── expected.json
│ │ │ └── runme.sh
│ │ ├── pool-padding/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── q40_linear_followed_slice/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── qmul/
│ │ │ ├── graph.nnef
│ │ │ ├── graph.quant
│ │ │ ├── io.npz
│ │ │ └── runme.sh
│ │ ├── range-slice-dyn-tile/
│ │ │ ├── model.nnef.tgz
│ │ │ └── runme.sh
│ │ ├── reshape/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── reshape_with_bc/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── sdpa/
│ │ │ ├── simple-causal-f32/
│ │ │ │ ├── graph.nnef
│ │ │ │ ├── io.npz
│ │ │ │ └── runme.sh
│ │ │ ├── simple-f16/
│ │ │ │ ├── graph.nnef
│ │ │ │ ├── io.npz
│ │ │ │ └── runme.sh
│ │ │ ├── simple-grouped-query-att-f32/
│ │ │ │ ├── io.npz
│ │ │ │ ├── model.nnef.tgz
│ │ │ │ └── runme.sh
│ │ │ ├── simple-mask-f32/
│ │ │ │ ├── graph.nnef
│ │ │ │ ├── io.npz
│ │ │ │ └── runme.sh
│ │ │ ├── simple-non-causal-f32/
│ │ │ │ ├── graph.nnef
│ │ │ │ ├── io.npz
│ │ │ │ └── runme.sh
│ │ │ └── simple-scale-f32/
│ │ │ ├── graph.nnef
│ │ │ ├── io.npz
│ │ │ └── runme.sh
│ │ ├── slice-over-slice-optim-loop/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── softmax/
│ │ │ ├── softmax-change-axis/
│ │ │ │ ├── expected
│ │ │ │ ├── graph.nnef
│ │ │ │ └── runme.sh
│ │ │ ├── softmax-change-axis-1/
│ │ │ │ ├── expected
│ │ │ │ ├── graph.nnef
│ │ │ │ └── runme.sh
│ │ │ └── softmax-quant/
│ │ │ ├── expected/
│ │ │ │ ├── graph.nnef
│ │ │ │ └── graph.quant
│ │ │ ├── model/
│ │ │ │ ├── graph.nnef
│ │ │ │ └── graph.quant
│ │ │ └── runme.sh
│ │ ├── submodel/
│ │ │ ├── expected
│ │ │ ├── graph.nnef
│ │ │ ├── graph.quant
│ │ │ ├── nnet2/
│ │ │ │ ├── graph.nnef
│ │ │ │ └── graph.quant
│ │ │ └── runme.sh
│ │ ├── tdim-cmp/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── test_all_reduce/
│ │ │ ├── io.npz
│ │ │ ├── model.nnef.tgz
│ │ │ └── runme.sh
│ │ ├── test_any_reduce/
│ │ │ ├── io.npz
│ │ │ ├── model.nnef.tgz
│ │ │ └── runme.sh
│ │ ├── test_manage_gru_states/
│ │ │ ├── io.npz
│ │ │ ├── model.nnef.tgz
│ │ │ └── runme.sh
│ │ ├── test_stft_smaller_win/
│ │ │ ├── io.npz
│ │ │ ├── model.nnef.tgz
│ │ │ └── runme.sh
│ │ ├── test_upcast_f32_attn/
│ │ │ ├── io.npz
│ │ │ ├── model.nnef.tgz
│ │ │ └── runme.sh
│ │ ├── tile-with-tdim/
│ │ │ ├── graph.nnef
│ │ │ └── runme.sh
│ │ ├── uniform-mul/
│ │ │ ├── expected
│ │ │ ├── graph.nnef
│ │ │ ├── io.npz
│ │ │ └── runme.sh
│ │ └── variable-in-fragment/
│ │ ├── graph.nnef
│ │ └── runme.sh
│ ├── parakeet-tdt-600m-v3/
│ │ └── ci.sh
│ ├── pre-optimized-graphes/
│ │ ├── .gitignore
│ │ ├── hey_snips_v4_model17/
│ │ │ ├── expected
│ │ │ └── runme.sh
│ │ └── mdl-en-2019-Q3-librispeech/
│ │ ├── expected
│ │ └── runme.sh
│ ├── tf-inceptionv3/
│ │ ├── Cargo.toml
│ │ ├── benches/
│ │ │ └── inceptionv3.rs
│ │ ├── download.sh
│ │ └── src/
│ │ └── lib.rs
│ ├── tf-mobilenet-v2/
│ │ ├── Cargo.toml
│ │ ├── download.sh
│ │ └── src/
│ │ └── lib.rs
│ └── tfl-mobilenet-v2-q/
│ ├── Cargo.toml
│ ├── download.sh
│ └── src/
│ └── lib.rs
├── hir/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── src/
│ ├── framework.rs
│ ├── infer/
│ │ ├── analyser.rs
│ │ ├── fact.rs
│ │ ├── factoid.rs
│ │ ├── helpers.rs
│ │ ├── mod.rs
│ │ ├── model.rs
│ │ ├── ops.rs
│ │ ├── optim.rs
│ │ └── rules/
│ │ ├── cache.rs
│ │ ├── expr.rs
│ │ ├── mod.rs
│ │ ├── path.rs
│ │ ├── proxies.rs
│ │ └── solver.rs
│ ├── lib.rs
│ ├── macros.rs
│ └── ops/
│ ├── activations.rs
│ ├── array/
│ │ ├── add_dims.rs
│ │ ├── array_feature_extractor.rs
│ │ ├── broadcast.rs
│ │ ├── concat.rs
│ │ ├── constant_like.rs
│ │ ├── constant_of_shape.rs
│ │ ├── crop.rs
│ │ ├── dyn_slice.rs
│ │ ├── flatten.rs
│ │ ├── gather.rs
│ │ ├── gather_elements.rs
│ │ ├── gather_nd.rs
│ │ ├── mod.rs
│ │ ├── pad.rs
│ │ ├── permute_axes.rs
│ │ ├── range.rs
│ │ ├── reshape.rs
│ │ ├── rm_dims.rs
│ │ ├── scatter_elements.rs
│ │ ├── scatter_nd.rs
│ │ ├── shape.rs
│ │ ├── size.rs
│ │ ├── slice.rs
│ │ ├── split.rs
│ │ ├── squeeze.rs
│ │ ├── strided_slice.rs
│ │ └── tile.rs
│ ├── binary.rs
│ ├── cast.rs
│ ├── cnn/
│ │ ├── conv.rs
│ │ ├── mod.rs
│ │ └── pools.rs
│ ├── downsample.rs
│ ├── dummy.rs
│ ├── element_wise.rs
│ ├── expandable.rs
│ ├── identity.rs
│ ├── konst.rs
│ ├── logic.rs
│ ├── matmul.rs
│ ├── mod.rs
│ ├── nn/
│ │ ├── global_pools.rs
│ │ ├── layer_max.rs
│ │ ├── mod.rs
│ │ ├── reduce.rs
│ │ └── softmax.rs
│ ├── quant.rs
│ ├── scan.rs
│ ├── source.rs
│ └── unimpl.rs
├── libcli/
│ ├── Cargo.toml
│ ├── src/
│ │ ├── annotations.rs
│ │ ├── display_params.rs
│ │ ├── draw.rs
│ │ ├── export.rs
│ │ ├── lib.rs
│ │ ├── model.rs
│ │ ├── profile.rs
│ │ ├── tensor.rs
│ │ ├── terminal.rs
│ │ └── time.rs
│ └── validate_wires.py
├── linalg/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── README.md
│ ├── arm32/
│ │ ├── armv7neon/
│ │ │ ├── armv7neon_mmm_f32_32x1_core.tmpl
│ │ │ ├── armv7neon_mmm_f32_8x1_core.tmpl
│ │ │ ├── armv7neon_mmm_f32_8x4_core.tmpl
│ │ │ ├── armv7neon_mmm_f32_8x6_core.tmpl
│ │ │ ├── armv7neon_mmm_f32_per_cols.tmpliq
│ │ │ ├── armv7neon_mmm_f32_per_rows.tmpliq
│ │ │ ├── armv7neon_mmm_f32_scalars.tmpliq
│ │ │ ├── armv7neon_mmm_i32_32x1.tmpl
│ │ │ ├── armv7neon_mmm_i32_8x4.tmpl
│ │ │ ├── armv7neon_mmm_i32_per_cols.tmpliq
│ │ │ ├── armv7neon_mmm_i32_per_rows.tmpliq
│ │ │ ├── armv7neon_mmm_i32_scalars.tmpliq
│ │ │ ├── armv7neon_mmm_i32_scale_q8_q15.tmpliq
│ │ │ ├── armv7neon_mmm_q_per_col.tmpliq
│ │ │ ├── armv7neon_mmm_q_per_row.tmpliq
│ │ │ ├── armv7neon_mmm_q_scalar.tmpliq
│ │ │ ├── armv7neon_prefetch.tmpl
│ │ │ ├── armv7neon_sigmoid_f32_4n.tmpl
│ │ │ ├── armv7neon_tanh_f32_4n.tmpl
│ │ │ └── dispatcher.tmpliq
│ │ └── armvfpv2/
│ │ ├── armvfpv2_mmm_f32_4x4.tmpl
│ │ └── dispatcher.tmpliq
│ ├── arm64/
│ │ ├── apple_amx/
│ │ │ ├── apple_amx_mmm_f16_64x1.tmpl
│ │ │ ├── apple_amx_mmm_f16_64x32.tmpl
│ │ │ ├── apple_amx_mmm_f32_32x1.tmpl
│ │ │ ├── apple_amx_mmm_f32_32x32.tmpl
│ │ │ ├── dispatcher.tmpliq
│ │ │ └── instructions.rs
│ │ ├── arm64fp16/
│ │ │ ├── arm64fp16_leaky_relu_f16_8n.tmpl
│ │ │ ├── arm64fp16_mmm_8h_per_col.tmpliq
│ │ │ ├── arm64fp16_mmm_8h_per_row.tmpliq
│ │ │ ├── arm64fp16_mmm_8h_scalar.tmpliq
│ │ │ ├── arm64fp16_mmm_f16_128x1/
│ │ │ │ ├── loop1/
│ │ │ │ │ ├── cortex_a53.tmpli
│ │ │ │ │ └── naive.tmpli
│ │ │ │ └── loop2/
│ │ │ │ └── cortex_a55.tmpli
│ │ │ ├── arm64fp16_mmm_f16_128x1_core.tmpl
│ │ │ ├── arm64fp16_mmm_f16_16x8/
│ │ │ │ ├── loop1/
│ │ │ │ │ └── naive.tmpli
│ │ │ │ └── loop2/
│ │ │ │ └── cortex_a55.tmpli
│ │ │ ├── arm64fp16_mmm_f16_16x8_core.tmpl
│ │ │ ├── arm64fp16_mmm_f16_32x4/
│ │ │ │ ├── loop1/
│ │ │ │ │ └── naive.tmpli
│ │ │ │ └── loop2/
│ │ │ │ └── cortex_a55.tmpli
│ │ │ ├── arm64fp16_mmm_f16_32x4_core.tmpl
│ │ │ ├── arm64fp16_mmm_f16_32x6.core.tmpl
│ │ │ ├── arm64fp16_mmm_f16_64x1.core.tmpl
│ │ │ ├── arm64fp16_mmm_f16_64x3.core.tmpl
│ │ │ ├── arm64fp16_mmm_f16_per_cols.tmpliq
│ │ │ ├── arm64fp16_mmm_f16_per_rows.tmpliq
│ │ │ ├── arm64fp16_mmm_f16_scalars.tmpliq
│ │ │ ├── arm64fp16_mmm_load_tile.tmpliq
│ │ │ ├── arm64fp16_sigmoid_f16_8n.tmpl
│ │ │ ├── arm64fp16_tanh_f16_8n.tmpl
│ │ │ ├── dispatcher.tmpliq
│ │ │ ├── dummy_fmla_no_pragma.S
│ │ │ └── dummy_fmla_pragma.S
│ │ └── arm64simd/
│ │ ├── arm64simd_mmm_4s_per_col.tmpliq
│ │ ├── arm64simd_mmm_4s_per_row.tmpliq
│ │ ├── arm64simd_mmm_4s_scalar.tmpliq
│ │ ├── arm64simd_mmm_f32_12x8/
│ │ │ ├── packed_packed_loop1/
│ │ │ │ ├── ldr_w_no_preload.tmpli
│ │ │ │ ├── ldr_w_preload.tmpli
│ │ │ │ ├── ldr_x_preload.tmpli
│ │ │ │ └── naive.tmpli
│ │ │ └── packed_packed_loop2/
│ │ │ └── cortex_a55.tmpli
│ │ ├── arm64simd_mmm_f32_12x8_core.tmpl
│ │ ├── arm64simd_mmm_f32_16x4/
│ │ │ ├── packed_packed_loop1/
│ │ │ │ ├── cortex_a53.tmpli
│ │ │ │ └── naive.tmpli
│ │ │ └── packed_packed_loop2/
│ │ │ └── cortex_a55.tmpli
│ │ ├── arm64simd_mmm_f32_16x4_core.tmpl
│ │ ├── arm64simd_mmm_f32_24x4/
│ │ │ ├── loop2/
│ │ │ │ └── cortex_a55.tmpli
│ │ │ └── packed_packed_loop1/
│ │ │ ├── cortex_a53.tmpli
│ │ │ ├── cortex_a55.tmpli
│ │ │ └── naive.tmpli
│ │ ├── arm64simd_mmm_f32_24x4_core.tmpl
│ │ ├── arm64simd_mmm_f32_32x1_core.tmpl
│ │ ├── arm64simd_mmm_f32_32x3_core.tmpl
│ │ ├── arm64simd_mmm_f32_64x1/
│ │ │ ├── loop1/
│ │ │ │ ├── cortex_a53.tmpli
│ │ │ │ └── naive.tmpli
│ │ │ └── loop2/
│ │ │ ├── cortex_a55.tmpli
│ │ │ └── naive.tmpli
│ │ ├── arm64simd_mmm_f32_64x1_core.tmpl
│ │ ├── arm64simd_mmm_f32_8x8/
│ │ │ ├── packed_packed_loop1/
│ │ │ │ ├── broken_chains.tmpli
│ │ │ │ ├── ldr_w_no_preload.tmpli
│ │ │ │ ├── ldr_w_preload.tmpli
│ │ │ │ ├── ldr_x_no_preload.tmpli
│ │ │ │ ├── ldr_x_preload.tmpli
│ │ │ │ └── naive.tmpli
│ │ │ └── packed_packed_loop2/
│ │ │ ├── broken_chains.tmpli
│ │ │ └── cortex_a55.tmpli
│ │ ├── arm64simd_mmm_f32_8x8_core.tmpl
│ │ ├── arm64simd_mmm_f32_per_cols.tmpliq
│ │ ├── arm64simd_mmm_f32_per_rows.tmpliq
│ │ ├── arm64simd_mmm_f32_scalars.tmpliq
│ │ ├── arm64simd_mmm_i32_64x1.tmpl
│ │ ├── arm64simd_mmm_i32_8x8.tmpl
│ │ ├── arm64simd_mmm_i32_per_cols.tmpliq
│ │ ├── arm64simd_mmm_i32_per_rows.tmpliq
│ │ ├── arm64simd_mmm_i32_scalars.tmpliq
│ │ ├── arm64simd_mmm_i32_scale_q16_q31.tmpliq
│ │ ├── arm64simd_mmm_load_tile.tmpliq
│ │ ├── arm64simd_sigmoid_f32_4n.tmpl
│ │ ├── arm64simd_tanh_f32_4n.tmpl
│ │ └── dispatcher.tmpliq
│ ├── benches/
│ │ ├── arm32neon.rs
│ │ ├── arm64.rs
│ │ ├── arm64simd.rs
│ │ ├── intel.rs
│ │ ├── leaky_relu.rs
│ │ ├── mat_vec.rs
│ │ ├── mm_for_asr_am.rs
│ │ ├── mm_for_inception.rs
│ │ ├── mm_for_wavenet_hw.rs
│ │ ├── sigmoid.rs
│ │ ├── softmax.rs
│ │ ├── utils.rs
│ │ ├── virtual_im2col.rs
│ │ └── x86_64.rs
│ ├── build.rs
│ ├── cost_model/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ └── main.rs
│ │ └── train/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── runme.sh
│ │ └── train.py
│ ├── matmul-bench/
│ │ ├── Cargo.toml
│ │ ├── benches/
│ │ │ └── matmul.rs
│ │ ├── build.rs
│ │ ├── c/
│ │ │ ├── packed_tile_4x4.c
│ │ │ ├── packed_tile_8x8.c
│ │ │ ├── tile_1x1.c
│ │ │ ├── tile_2x2.c
│ │ │ ├── tile_4x4.c
│ │ │ └── tile_8x8.c
│ │ └── src/
│ │ └── lib.rs
│ ├── src/
│ │ ├── arm32/
│ │ │ ├── armv7neon.rs
│ │ │ ├── armvfpv2.rs
│ │ │ ├── cortex_a7.rs
│ │ │ ├── cortex_a7.txt
│ │ │ ├── cortex_a9.rs
│ │ │ └── cortex_a9.txt
│ │ ├── arm32.rs
│ │ ├── arm64/
│ │ │ ├── apple_amx.rs
│ │ │ ├── arm64fp16/
│ │ │ │ ├── by_scalar.rs
│ │ │ │ ├── leaky_relu.rs
│ │ │ │ ├── max.rs
│ │ │ │ ├── panel_extract.rs
│ │ │ │ ├── sum.rs
│ │ │ │ └── unicast.rs
│ │ │ ├── arm64fp16.rs
│ │ │ ├── arm64simd/
│ │ │ │ ├── by_scalar.rs
│ │ │ │ ├── leaky_relu.rs
│ │ │ │ ├── max.rs
│ │ │ │ ├── panel_extract.rs
│ │ │ │ ├── softmax.rs
│ │ │ │ ├── sum.rs
│ │ │ │ └── unicast.rs
│ │ │ ├── arm64simd.rs
│ │ │ ├── cortex_a53.rs
│ │ │ ├── cortex_a55.rs
│ │ │ ├── cortex_a72.rs
│ │ │ └── cortex_a73.rs
│ │ ├── arm64.rs
│ │ ├── frame/
│ │ │ ├── block_quant/
│ │ │ │ ├── helpers.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── q4_0.rs
│ │ │ │ ├── q8_1.rs
│ │ │ │ ├── storage.rs
│ │ │ │ └── value.rs
│ │ │ ├── by_scalar.rs
│ │ │ ├── element_wise.rs
│ │ │ ├── element_wise_helper.rs
│ │ │ ├── leaky_relu.rs
│ │ │ ├── lut.rs
│ │ │ ├── mmm/
│ │ │ │ ├── cost_model.rs
│ │ │ │ ├── fuse.rs
│ │ │ │ ├── input_store.rs
│ │ │ │ ├── kernel.rs
│ │ │ │ ├── macros.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── panel_extract.rs
│ │ │ │ ├── scratch.rs
│ │ │ │ ├── storage.rs
│ │ │ │ └── tests/
│ │ │ │ ├── frame.rs
│ │ │ │ ├── fuse.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── packed_packed.rs
│ │ │ │ ├── q_scale.rs
│ │ │ │ └── store.rs
│ │ │ ├── mod.rs
│ │ │ ├── pack.rs
│ │ │ ├── reduce/
│ │ │ │ ├── max.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── softmax.rs
│ │ │ │ └── sum.rs
│ │ │ ├── sigmoid.rs
│ │ │ ├── tanh.rs
│ │ │ ├── unicast.rs
│ │ │ └── weights.rs
│ │ ├── generic/
│ │ │ ├── by_scalar.rs
│ │ │ ├── erf.rs
│ │ │ ├── leaky_relu.rs
│ │ │ ├── lut.rs
│ │ │ ├── mmm.rs
│ │ │ ├── reduce.rs
│ │ │ ├── rounding.rs
│ │ │ ├── sigmoid.rs
│ │ │ ├── tanh.rs
│ │ │ └── unicast.rs
│ │ ├── generic.rs
│ │ ├── hwbench/
│ │ │ ├── bandwidth.rs
│ │ │ ├── mod.rs
│ │ │ └── runner.rs
│ │ ├── lib.rs
│ │ ├── multithread.rs
│ │ ├── wasm.rs
│ │ ├── x86_64_fma/
│ │ │ ├── by_scalar.rs
│ │ │ ├── intel.rs
│ │ │ ├── max.rs
│ │ │ ├── mmm.rs
│ │ │ ├── panel_extract.rs
│ │ │ └── softmax.rs
│ │ └── x86_64_fma.rs
│ ├── tests/
│ │ └── virtual_im2col.rs
│ └── x86_64/
│ ├── avx512/
│ │ ├── 10x1/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 1x1/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512.tmpli
│ │ │ ├── unroll-16.tmpli
│ │ │ ├── unroll-4.tmpli
│ │ │ ├── unroll-8.tmpli
│ │ │ └── unroll.tmpli
│ │ ├── 1x12/
│ │ │ └── packed_packed_loop1/
│ │ │ └── avx-512.tmpli
│ │ ├── 2x5/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 2x6/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 3x4/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 4x3/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 5x2/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 6x1/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 6x2/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 7x1/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 8x1/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── 8x2/
│ │ │ └── packed_packed_loop1/
│ │ │ └── avx-512.tmpli
│ │ ├── 8x8/
│ │ │ └── packed_packed_loop1/
│ │ │ ├── avx-512-unroll.tmpli
│ │ │ └── avx-512.tmpli
│ │ ├── avx512_mmm_f32_128x1.tmpl
│ │ ├── avx512_mmm_f32_16x1.tmpl
│ │ ├── avx512_mmm_f32_16x12.tmpl
│ │ ├── avx512_mmm_f32_16x8.tmpl
│ │ ├── avx512_mmm_f32_32x5.tmpl
│ │ ├── avx512_mmm_f32_32x6.tmpl
│ │ ├── avx512_mmm_f32_48x4.tmpl
│ │ ├── avx512_mmm_f32_64x3.tmpl
│ │ ├── avx512_mmm_f32_80x2.tmpl
│ │ ├── avx512_mmm_load_tile.tmpliq
│ │ ├── dispatcher.tmpliq
│ │ ├── f32_per_cols.tmpliq
│ │ ├── f32_per_rows.tmpliq
│ │ ├── f32_scalars.tmpliq
│ │ ├── i32_per_cols.tmpliq
│ │ ├── i32_per_rows.tmpliq
│ │ ├── i32_scalars.tmpliq
│ │ ├── postamble.tmpliq
│ │ ├── preamble.tmpliq
│ │ ├── sigmoid_f32.tmpl
│ │ ├── tanh_f32.tmpl
│ │ ├── zmm_per_col.tmpliq
│ │ ├── zmm_per_row.tmpliq
│ │ └── zmm_scalar.tmpliq
│ └── fma/
│ ├── 10x1/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 2x5/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 2x6/
│ │ └── packed_packed_loop1/
│ │ ├── original-unroll.tmpli
│ │ └── original.tmpli
│ ├── 3x4/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 4x3/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 5x2/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 6x1/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 6x2/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 7x1/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 8x1/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── 8x8/
│ │ └── packed_packed_loop1/
│ │ ├── avx-unroll.tmpli
│ │ └── avx.tmpli
│ ├── avx2_mmm_i32_8x8.tmpl
│ ├── dispatcher.tmpliq
│ ├── fma_mmm_f32_16x5.tmpl
│ ├── fma_mmm_f32_16x6.tmpl
│ ├── fma_mmm_f32_24x4.tmpl
│ ├── fma_mmm_f32_32x1.tmpl
│ ├── fma_mmm_f32_32x3.tmpl
│ ├── fma_mmm_f32_40x2.tmpl
│ ├── fma_mmm_f32_64x1.tmpl
│ ├── fma_mmm_f32_8x8.tmpl
│ ├── fma_mmm_f32_per_cols.tmpliq
│ ├── fma_mmm_f32_per_rows.tmpliq
│ ├── fma_mmm_f32_scalars.tmpliq
│ ├── fma_mmm_i32_per_cols.tmpliq
│ ├── fma_mmm_i32_per_rows.tmpliq
│ ├── fma_mmm_i32_scalars.tmpliq
│ ├── fma_mmm_load_tile.tmpliq
│ ├── fma_mmm_ymm_per_col.tmpliq
│ ├── fma_mmm_ymm_per_row.tmpliq
│ ├── fma_mmm_ymm_scalar.tmpliq
│ ├── fma_sigmoid_f32.tmpl
│ ├── fma_tanh_f32.tmpl
│ ├── postamble.tmpliq
│ └── preamble.tmpliq
├── metal/
│ ├── Cargo.toml
│ ├── README.md
│ ├── benches/
│ │ └── metal_gemm.rs
│ └── src/
│ ├── command_buffer.rs
│ ├── context.rs
│ ├── encoder.rs
│ ├── func_constants.rs
│ ├── kernels/
│ │ ├── array/
│ │ │ ├── array_ops.metal
│ │ │ ├── cast.rs
│ │ │ ├── copy.rs
│ │ │ ├── dispatch.rs
│ │ │ ├── mod.rs
│ │ │ └── rotate_half.rs
│ │ ├── bin_ops.metal
│ │ ├── bin_ops.rs
│ │ ├── conv.metal
│ │ ├── conv.rs
│ │ ├── element_wise.metal
│ │ ├── element_wise.rs
│ │ ├── matmul/
│ │ │ ├── basic/
│ │ │ │ ├── basic_mat_mul.metal
│ │ │ │ └── mod.rs
│ │ │ ├── ggml_gemm/
│ │ │ │ ├── README.md
│ │ │ │ ├── ggml_mm_mv.metal
│ │ │ │ └── mod.rs
│ │ │ ├── mfa/
│ │ │ │ ├── libMetalFlashAttention-ios.metallib
│ │ │ │ ├── libMetalFlashAttention-macos.metallib
│ │ │ │ └── mod.rs
│ │ │ ├── mlx_gemm/
│ │ │ │ ├── mlx_gemm.metal
│ │ │ │ ├── mlx_gemv.metal
│ │ │ │ └── mod.rs
│ │ │ └── mod.rs
│ │ ├── mod.rs
│ │ ├── nn/
│ │ │ ├── apply_rope.rs
│ │ │ ├── gelu_approximate.rs
│ │ │ ├── leaky_relu.rs
│ │ │ ├── mod.rs
│ │ │ ├── nn_ops.metal
│ │ │ ├── reduce.rs
│ │ │ ├── rms_norm.rs
│ │ │ ├── scaled_masked_softmax.rs
│ │ │ ├── silu.rs
│ │ │ └── softmax.rs
│ │ └── utils.rs
│ ├── lib.rs
│ ├── ops/
│ │ ├── conv.rs
│ │ ├── fused_axis_op.rs
│ │ ├── gemm.rs
│ │ └── mod.rs
│ ├── rewrite_rules/
│ │ ├── add_matmul_broadcast.rs
│ │ ├── fuse_axis_op.rs
│ │ ├── mod.rs
│ │ └── untranspose_matmul_output.rs
│ ├── tensor.rs
│ ├── tests.rs
│ ├── transform.rs
│ └── utils.rs
├── nnef/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── cli/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── main.rs
│ ├── nnef-resources/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── json_loader.rs
│ │ │ └── lib.rs
│ │ └── tests/
│ │ ├── nnef_with_json/
│ │ │ ├── graph.nnef
│ │ │ └── src_config.json
│ │ └── test_json_resource.rs
│ ├── src/
│ │ ├── ast/
│ │ │ ├── dump.rs
│ │ │ ├── dump_doc.rs
│ │ │ ├── parse.rs
│ │ │ └── quant.rs
│ │ ├── ast.rs
│ │ ├── deser.rs
│ │ ├── framework.rs
│ │ ├── lib.rs
│ │ ├── liquid.rs
│ │ ├── ops/
│ │ │ ├── core/
│ │ │ │ ├── broadcast.rs
│ │ │ │ ├── cast.rs
│ │ │ │ ├── complex.rs
│ │ │ │ ├── downsample.rs
│ │ │ │ ├── dyn_slice.rs
│ │ │ │ ├── einsum.rs
│ │ │ │ ├── fft.rs
│ │ │ │ ├── gather.rs
│ │ │ │ ├── gelu_approximate.rs
│ │ │ │ ├── is_inf.rs
│ │ │ │ ├── matmul.rs
│ │ │ │ ├── one_hot.rs
│ │ │ │ ├── qconv.rs
│ │ │ │ ├── qmatmul.rs
│ │ │ │ ├── range.rs
│ │ │ │ ├── reduce.rs
│ │ │ │ ├── rms_norm.rs
│ │ │ │ ├── scan.rs
│ │ │ │ ├── scatter.rs
│ │ │ │ ├── shape_of.rs
│ │ │ │ ├── silu.rs
│ │ │ │ ├── softmax.rs
│ │ │ │ ├── source.rs
│ │ │ │ ├── submodel.rs
│ │ │ │ ├── topk.rs
│ │ │ │ └── trilu.rs
│ │ │ ├── core.rs
│ │ │ ├── mod.rs
│ │ │ ├── nnef/
│ │ │ │ ├── deser.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── ser.rs
│ │ │ └── resource.rs
│ │ ├── registry.rs
│ │ ├── resource.rs
│ │ ├── ser.rs
│ │ ├── tensors.rs
│ │ └── transform.rs
│ ├── stdlib.nnef
│ └── tests/
│ ├── alexnet.nnef
│ └── parse.rs
├── onnx/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── benches/
│ │ ├── linear_classifier.rs
│ │ └── linear_regressor.rs
│ ├── build-proto.rs
│ ├── protos/
│ │ └── onnx/
│ │ ├── onnx-operators.proto3
│ │ ├── onnx.proto
│ │ └── onnx.proto3
│ ├── src/
│ │ ├── data_resolver.rs
│ │ ├── lib.rs
│ │ ├── model.rs
│ │ ├── ops/
│ │ │ ├── array/
│ │ │ │ ├── compress.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── nonzero.rs
│ │ │ │ ├── one_hot.rs
│ │ │ │ ├── pad.rs
│ │ │ │ ├── shape.rs
│ │ │ │ ├── slice.rs
│ │ │ │ ├── split.rs
│ │ │ │ ├── squeeze.rs
│ │ │ │ ├── topk.rs
│ │ │ │ ├── trilu.rs
│ │ │ │ └── unsqueeze.rs
│ │ │ ├── cast.rs
│ │ │ ├── cumsum.rs
│ │ │ ├── d2s.rs
│ │ │ ├── einsum.rs
│ │ │ ├── fft.rs
│ │ │ ├── grid_sample.rs
│ │ │ ├── logic.rs
│ │ │ ├── math/
│ │ │ │ ├── clip.rs
│ │ │ │ ├── gemm.rs
│ │ │ │ ├── mat_mul_integer.rs
│ │ │ │ ├── pow.rs
│ │ │ │ └── rem.rs
│ │ │ ├── math.rs
│ │ │ ├── ml/
│ │ │ │ ├── category_mapper.rs
│ │ │ │ ├── linear_classifier.rs
│ │ │ │ ├── linear_regressor.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── normalizer.rs
│ │ │ │ └── tree_ensemble_classifier.rs
│ │ │ ├── mod.rs
│ │ │ ├── multinomial.rs
│ │ │ ├── nn/
│ │ │ │ ├── batch_norm.rs
│ │ │ │ ├── conv_transpose.rs
│ │ │ │ ├── dropout.rs
│ │ │ │ ├── instance_norm.rs
│ │ │ │ ├── layer_norm.rs
│ │ │ │ ├── lrn.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── reduce.rs
│ │ │ ├── non_max_suppression.rs
│ │ │ ├── quant.rs
│ │ │ ├── random.rs
│ │ │ ├── rec/
│ │ │ │ ├── common.rs
│ │ │ │ ├── gru.rs
│ │ │ │ ├── lstm.rs
│ │ │ │ ├── rnn.rs
│ │ │ │ └── scan.rs
│ │ │ ├── rec.rs
│ │ │ ├── resize.rs
│ │ │ └── s2d.rs
│ │ ├── pb_helpers.rs
│ │ ├── prost/
│ │ │ └── onnx.rs
│ │ └── tensor.rs
│ └── test_cases/
│ ├── byte_sb_bidi_lstm/
│ │ ├── README.md
│ │ ├── generate_io.py
│ │ ├── io.npz
│ │ └── model.onnx
│ ├── deconv_group/
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ └── vars.sh
│ ├── lgbm_classifier_tensor/
│ │ ├── generate_io.py
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ └── vars.sh
│ ├── lgbm_regressor_tensor/
│ │ ├── generate_io.py
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ └── vars.sh
│ ├── linear_classifier/
│ │ └── model.onnx
│ ├── linear_regressor/
│ │ └── model.onnx
│ ├── qlstm_3-2-3_T3_S1/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── qrelu_1/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── qrelu_2/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── qsigmoid_1/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── qsigmoid_2/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── qtanh_1/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── qtanh_2/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── qtdnn_10x5_101_i32_biases/
│ │ ├── final.mdl
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ ├── model.raw
│ │ └── vars.sh
│ ├── run_all.sh
│ ├── tinyyolov2/
│ │ ├── io.npz
│ │ └── vars.sh
│ ├── transformer-mlm/
│ │ ├── generate_io.py
│ │ ├── io.npz
│ │ └── vars.sh
│ ├── xgboost_classifier_tree/
│ │ ├── generate_io.py
│ │ ├── io.npz
│ │ ├── model.onnx
│ │ └── vars.sh
│ └── xgboost_regressor_tree/
│ ├── generate_io.py
│ ├── io.npz
│ ├── model.onnx
│ └── vars.sh
├── onnx-opl/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── src/
│ ├── grid_sample.rs
│ ├── lib.rs
│ ├── lrn.rs
│ ├── ml/
│ │ ├── category_mapper.rs
│ │ ├── mod.rs
│ │ ├── tree.rs
│ │ └── tree_ensemble_classifier.rs
│ ├── multinomial.rs
│ ├── non_max_suppression.rs
│ ├── random.rs
│ └── resize.rs
├── post-release.sh
├── pulse/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── src/
│ ├── fact.rs
│ ├── lib.rs
│ ├── macros.rs
│ ├── model.rs
│ └── ops/
│ ├── array/
│ │ ├── broadcast.rs
│ │ ├── concat.rs
│ │ ├── mask.rs
│ │ ├── mod.rs
│ │ ├── pad.rs
│ │ └── slice.rs
│ ├── cnn/
│ │ ├── conv.rs
│ │ ├── deconv.rs
│ │ ├── mod.rs
│ │ └── pools.rs
│ ├── delay.rs
│ ├── downsample.rs
│ ├── dummy.rs
│ ├── fft.rs
│ ├── identity.rs
│ ├── mask.rs
│ ├── mod.rs
│ ├── scan.rs
│ ├── slice.rs
│ └── source.rs
├── pulse-opl/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── src/
│ ├── concat.rs
│ ├── deconv_delay.rs
│ ├── delay.rs
│ ├── lib.rs
│ ├── mask.rs
│ ├── pad.rs
│ └── slice.rs
├── release.sh
├── rustfmt.toml
├── tensorflow/
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── benches/
│ │ └── hey_snips_3.pb
│ ├── build-proto.rs
│ ├── examples/
│ │ └── plus3.rs
│ ├── protos/
│ │ └── tensorflow/
│ │ └── core/
│ │ ├── framework/
│ │ │ ├── attr_value.proto
│ │ │ ├── function.proto
│ │ │ ├── graph.proto
│ │ │ ├── node_def.proto
│ │ │ ├── op_def.proto
│ │ │ ├── resource_handle.proto
│ │ │ ├── tensor.proto
│ │ │ ├── tensor_shape.proto
│ │ │ ├── types.proto
│ │ │ ├── variable.proto
│ │ │ └── versions.proto
│ │ └── protobuf/
│ │ ├── meta_graph.proto
│ │ ├── saved_model.proto
│ │ ├── saved_object_graph.proto
│ │ ├── saver.proto
│ │ ├── struct.proto
│ │ └── trackable_object_graph.proto
│ ├── src/
│ │ ├── conform/
│ │ │ ├── mod.rs
│ │ │ └── tf.rs
│ │ ├── lib.rs
│ │ ├── model.rs
│ │ ├── ops/
│ │ │ ├── array/
│ │ │ │ ├── concatv2.rs
│ │ │ │ ├── expand_dims.rs
│ │ │ │ ├── fill.rs
│ │ │ │ ├── gather_nd.rs
│ │ │ │ ├── gather_v2.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── pack.rs
│ │ │ │ ├── pad.rs
│ │ │ │ ├── squeeze.rs
│ │ │ │ └── transpose.rs
│ │ │ ├── control_flow.rs
│ │ │ ├── logic.rs
│ │ │ ├── math/
│ │ │ │ └── reduce.rs
│ │ │ ├── math.rs
│ │ │ ├── mod.rs
│ │ │ ├── nn/
│ │ │ │ ├── conv2d.rs
│ │ │ │ ├── dw_conv2d.rs
│ │ │ │ ├── fused_batch_norm.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── pools.rs
│ │ │ │ └── s2b/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── raw.rs
│ │ │ │ └── unary.rs
│ │ │ ├── quant.rs
│ │ │ ├── random/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── philox.rs
│ │ │ │ └── random_uniform.rs
│ │ │ └── rec/
│ │ │ ├── block_lstm.rs
│ │ │ └── mod.rs
│ │ ├── prost/
│ │ │ ├── google.protobuf.rs
│ │ │ └── tensorflow.rs
│ │ ├── tensor.rs
│ │ └── tfpb.rs
│ └── tests/
│ ├── models/
│ │ └── plus3.pb
│ ├── ops_array_pack.rs
│ ├── ops_array_strided_slice.proptest-regressions
│ ├── ops_array_strided_slice.rs
│ ├── ops_fake_quant_with_min_max_vars.rs
│ ├── ops_nn_conv2d.proptest-regressions
│ ├── ops_nn_conv2d.rs
│ ├── ops_nn_dwconv2d.proptest-regressions
│ ├── ops_nn_dwconv2d.rs
│ ├── ops_nn_pools.proptest-regressions
│ ├── ops_nn_pools.rs
│ ├── ops_nn_space_to_batch.proptest-regressions
│ ├── ops_nn_space_to_batch.rs
│ ├── ops_random_uniform.rs
│ └── utils/
│ └── mod.rs
├── test-rt/
│ ├── infra/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── suite-onnx/
│ │ ├── Cargo.toml
│ │ ├── node.txt
│ │ ├── pytorch-converted.txt
│ │ ├── pytorch-operator.txt
│ │ ├── simple.txt
│ │ └── src/
│ │ └── lib.rs
│ ├── suite-unit/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── apply_rope.rs
│ │ ├── bin_einsum.rs
│ │ ├── binary.rs
│ │ ├── conv_f16.rs
│ │ ├── conv_f32.rs
│ │ ├── conv_q.rs
│ │ ├── deconv.rs
│ │ ├── downsample.rs
│ │ ├── elmwise.rs
│ │ ├── gelu_approximate.rs
│ │ ├── lib.rs
│ │ ├── matmul_q40.rs
│ │ ├── q_binary.rs
│ │ ├── q_elmwise.rs
│ │ ├── q_flavours.rs
│ │ ├── q_helpers.rs
│ │ ├── rms_norm.rs
│ │ ├── scaled_masked_softmax.rs
│ │ ├── sdpa.rs
│ │ ├── silu.rs
│ │ └── slice.rs
│ ├── test-blas/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── src/
│ │ │ └── lib.rs
│ │ └── suite.rs
│ ├── test-cuda/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── src/
│ │ │ └── lib.rs
│ │ └── suite.rs
│ ├── test-f16/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── src/
│ │ │ └── lib.rs
│ │ └── suite.rs
│ ├── test-metal/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── ggml_suite.rs
│ │ ├── src/
│ │ │ └── lib.rs
│ │ └── suite.rs
│ ├── test-nnef-cycle/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── src/
│ │ │ └── lib.rs
│ │ └── suite.rs
│ ├── test-onnx-core/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── debug-utils/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ ├── save_all.py
│ │ │ └── src/
│ │ │ └── main.rs
│ │ ├── include-passing-ignored.sh
│ │ └── src/
│ │ ├── bin/
│ │ │ └── reset-test-list.rs
│ │ └── lib.rs
│ ├── test-tflite/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── src/
│ │ │ ├── lib.rs
│ │ │ └── tflite_runtime.rs
│ │ └── suite.rs
│ └── test-unit-core/
│ ├── Cargo.toml
│ ├── build.rs
│ └── src/
│ ├── lib.rs
│ └── main.rs
├── test-suite.sh
├── tflite/
│ ├── Cargo.toml
│ ├── Readme.md
│ ├── schema/
│ │ └── tflite.fbs
│ └── src/
│ ├── lib.rs
│ ├── model.rs
│ ├── ops/
│ │ ├── array.rs
│ │ ├── cnn.rs
│ │ ├── element_wise.rs
│ │ ├── math.rs
│ │ ├── mod.rs
│ │ └── nn.rs
│ ├── registry.rs
│ ├── rewriter.rs
│ ├── ser.rs
│ ├── tensors.rs
│ └── tflite_generated.rs
├── transformers/
│ ├── Cargo.toml
│ └── src/
│ ├── lib.rs
│ ├── ops/
│ │ ├── apply_rope.rs
│ │ ├── dyn_kv_cache.rs
│ │ ├── flash_sdpa.rs
│ │ ├── mod.rs
│ │ ├── scaled_masked_softmax.rs
│ │ ├── sdpa.rs
│ │ └── streamed_sdpa.rs
│ └── rewriter.rs
└── yank.sh
================================================
FILE CONTENTS
================================================
================================================
FILE: .all_crates.sh
================================================
ALL_CRATES_PATH="data linalg core nnef nnef/nnef-resources pulse-opl pulse extra transformers hir tflite tensorflow onnx-opl onnx gpu metal cuda libcli api api/rs api/ffi api/proxy/sys api/proxy cli"
================================================
FILE: .change_crate_dep.sh
================================================
#!/bin/bash
crate=$1
version=$2
perl -pi -e "s/^($crate = {.*version *= *)\"([^\"]*)\"(.*)$/\$1\"=$version\"\$3/" \
`find . -name Cargo.toml \! -path "./target/*" \! -path "./issue*"`
================================================
FILE: .clang-format
================================================
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Never
IndentPPDirectives: BeforeHash
PPIndentWidth: 4
ColumnLimit: 100
# OneLineFormatOffRegex: '^\s*#\s*pragma\s+unroll\b'
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
groups:
actions:
patterns:
- "*"
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
groups:
rust-dependencies:
patterns:
- "*"
- package-ecosystem: "pip"
directory: "/api/py"
ignore:
# Only update them manually since updating them might break compatibility
- dependency-name: "numpy"
schedule:
interval: "weekly"
day: "monday"
================================================
FILE: .github/workflows/asan.yml
================================================
name: Sanitized build tests
on:
workflow_dispatch:
schedule:
- cron: '0 5 * * MON'
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
jobs:
sanitizer-address:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macOS-latest ]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v6
- name: Rustup update
run: rustup update
- name: Run sanitized tests
run: .travis/asan.sh
================================================
FILE: .github/workflows/binaries.yml
================================================
on:
release:
types:
- created
name: Upload Release Binaries
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
jobs:
assets:
name: Upload Release Binaries
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macOS-latest ]
arch: [ x86_64, aarch64, armv7 ]
include:
- os: ubuntu-latest
arch: x86_64
target: x86_64-unknown-linux-musl
musl: x86_64-linux-musl
- os: ubuntu-latest
arch: aarch64
target: aarch64-unknown-linux-musl
musl: aarch64-linux-musl
- os: ubuntu-latest
arch: armv7
target: armv7-unknown-linux-musleabihf
musl: armv7l-linux-musleabihf
- os: macOS-latest
arch: x86_64
target: x86_64-apple-darwin
- os: macOS-latest
arch: aarch64
target: aarch64-apple-darwin
exclude:
- os: macOS-latest
arch: armv7
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Extract version tag
id: version
run: echo value=$(echo ${{ github.ref }} | cut -f 3 -d / | sed 's/^v//' ) >> $GITHUB_OUTPUT
- name: Build tract
run: |
set -ex
target=${{matrix.target}}
version=${{steps.version.outputs.value}}
name=${target}-${version}
rustup update
rustup target add ${target}
if [ -n "${{matrix.musl}}" ]
then
MUSL_TRIPLE=${{matrix.musl}}
curl -s https://s3.amazonaws.com/tract-ci-builds/toolchains/${MUSL_TRIPLE}-cross.tgz | tar zx
MUSL_BIN=`pwd`/${MUSL_TRIPLE}-cross/bin
export PATH=$MUSL_BIN:$PATH
export TARGET_CC=$MUSL_BIN/${MUSL_TRIPLE}-gcc
RUST_TRIPLE_ENV=$(echo ${target} | tr 'a-z-' 'A-Z_')
export CARGO_TARGET_${RUST_TRIPLE_ENV}_CC=$TARGET_CC
export CARGO_TARGET_${RUST_TRIPLE_ENV}_LINKER=$TARGET_CC
fi
cargo build --target ${target} --release -p tract-cli
mkdir tract-$name
cp target/${target}/release/tract tract-${name}
tar czf tract-${name}.tgz tract-${name}
- name: Upload asset
uses: softprops/action-gh-release@v2
with:
files: tract-${{matrix.target}}-${{ steps.version.outputs.value }}.tgz
name: ${{ steps.version.outputs.value }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/cost_model.yml
================================================
on:
workflow_dispatch:
inputs:
dataset_id:
description: 'dataset identifier'
required: true
name: Generate cost model analysis dataset
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
jobs:
build:
name: Upload cost model tasks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [ "aarch64", "armv7" ]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Build and upload
run: ./.travis/cost_model_task_build.sh ${{matrix.target}} ${{github.event.inputs.dataset_id}}
env:
AWS_ACCESS_KEY_ID: ${{secrets.TRACT_CI_AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.TRACT_CI_AWS_SECRET_ACCESS_KEY}}
AWS_EC2_METADATA_DISABLED: true
================================================
FILE: .github/workflows/crates.yml
================================================
name: Rust crates
on:
pull_request:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
os: ${{steps.set-matrix.outputs.os}}
rust: ${{steps.set-matrix.outputs.rust}}
steps:
- id: set-matrix
env:
FULL: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
run: |
if [ "$FULL" == "true" ]
then
echo 'os=["ubuntu-latest", "macos-latest"]' >> $GITHUB_OUTPUT
echo 'rust=["1.91.0", "stable", "beta", "nightly"]' >> $GITHUB_OUTPUT
else
echo ::notice::Skipping macOS checks on PR and commit. Dispatch workflow manually if needed.
echo 'os=["ubuntu-latest"]' >> $GITHUB_OUTPUT
echo 'rust=["1.91.0"]' >> $GITHUB_OUTPUT
fi
crates:
name: ${{matrix.os}} / ${{matrix.crate}} / ${{matrix.rust}}
needs: prepare-matrix
strategy:
matrix:
os: ${{fromJson(needs.prepare-matrix.outputs.os)}}
rust: ${{fromJson(needs.prepare-matrix.outputs.rust)}}
crate: [ tract-data, tract-linalg, tract-core, tract-nnef, tract-hir, tract-onnx,
tract-pulse, tract-onnx-opl, tract-pulse-opl, tract,
test-unit-core, test-onnx-core, test-nnef-cycle, test-f16,
]
fail-fast: false
runs-on: ${{matrix.os}}
env:
RUSTUP_TOOLCHAIN: ${{matrix.rust}}
steps:
- uses: actions/checkout@v6
- name: Cargo test
run: cargo test -p ${{matrix.crate}}
cuda:
runs-on: cuda-lovelace
needs: prepare-matrix
strategy:
matrix:
rust: ${{fromJson(needs.prepare-matrix.outputs.rust)}}
fail-fast: false
env:
RUSTUP_TOOLCHAIN: ${{matrix.rust}}
steps:
- uses: actions/checkout@v6
- name: Cargo test
run: cargo test -p tract-cuda -p test-cuda
metal:
runs-on: macOS
needs: prepare-matrix
strategy:
matrix:
rust: ${{fromJson(needs.prepare-matrix.outputs.rust)}}
fail-fast: false
env:
RUSTUP_TOOLCHAIN: ${{matrix.rust}}
steps:
- uses: actions/checkout@v6
- name: Cargo test
run: cargo test -p tract-metal -p test-metal
pedantic:
name: fmt, clippy, etc (${{matrix.os}} / ${{matrix.rust}})
needs: prepare-matrix
strategy:
matrix:
os: ${{fromJson(needs.prepare-matrix.outputs.os)}}
rust: ${{fromJson(needs.prepare-matrix.outputs.rust)}}
fail-fast: false
runs-on: ${{matrix.os}}
env:
RUSTUP_TOOLCHAIN: ${{matrix.rust}}
steps:
- uses: actions/checkout@v6
- run: rustup component add clippy && cargo clippy
- name: fmt
run: rustup component add rustfmt && cargo fmt --check
- name: Warnings
env:
RUSTFLAGS: -D warnings
run: cargo check
cargo-deny:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install cargo-deny
run: |
curl -L https://github.com/EmbarkStudios/cargo-deny/releases/download/$VERSION/cargo-deny-$VERSION-x86_64-unknown-linux-musl.tar.gz \
| tar -zx --strip-components=1 "cargo-deny-$VERSION-x86_64-unknown-linux-musl/cargo-deny"
env:
VERSION: 0.18.9
- name: Run cargo-deny
run: .travis/cargo-deny-check.sh
================================================
FILE: .github/workflows/cross-platform.yml
================================================
name: Embedded targets
on:
pull_request:
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
RUSTUP_TOOLCHAIN: 1.91.0
jobs:
linux:
strategy:
fail-fast: false
matrix:
platform:
- raspbian
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-gnu-stretch
- armv6vfp-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf-stretch
- aarch64-unknown-linux-musl
- cortexa53-unknown-linux-musl
- armv7-unknown-linux-musl
- aarch64-linux-android
- armv7-linux-androideabi
- i686-linux-android
- x86_64-linux-android
- x86_64-unknown-linux-gnu-stretch
- wasm32-unknown-unknown
- wasm32-wasi
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Configure AWS Credentials
continue-on-error: true
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::567805100031:role/github-runner-tract-ci
aws-region: us-east-2
- uses: actions/cache@v5
with:
path: |
~/.rustup
~/.cargo/registry
~/.cargo/git
# ~/.cache/sccache
.cached
target
key: ${{ runner.os }}-${{matrix.platform}}-${{steps.date.outputs.date}}
- name: Setup wasmtime
if: ${{ matrix.platform }} == "wasm32-wasi"
uses: bytecodealliance/actions/wasmtime/setup@v1
- name: Cross script
env:
PLATFORM: ${{matrix.platform}}
AWS_EC2_METADATA_DISABLED: true
run: .travis/cross.sh
apple:
strategy:
fail-fast: false
matrix:
platform:
- aarch64-apple-ios
- aarch64-apple-darwin
runs-on: macos-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Configure AWS Credentials
continue-on-error: true
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::567805100031:role/github-runner-tract-ci
aws-region: us-east-2
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Cross script
env:
PLATFORM: ${{matrix.platform}}
run: .travis/cross.sh
================================================
FILE: .github/workflows/examples.yml
================================================
name: Examples
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
RUSTUP_TOOLCHAIN: 1.91.0
jobs:
examples:
runs-on: ubuntu-latest
outputs:
examples: ${{steps.set-matrix.outputs.examples}}
steps:
- uses: actions/checkout@v6
- id: set-matrix
run: |
echo examples=`find examples -name ci.sh | cut -d/ -f 2 | jq -Rsc '. / "\n" - [""]'` >> "$GITHUB_OUTPUT"
example:
name: ${{ matrix.ex }}
runs-on: ubuntu-latest
needs: examples
strategy:
fail-fast: false
matrix:
ex: ${{fromJSON(needs.examples.outputs.examples)}}
steps:
- uses: actions/checkout@v6
- name: Configure AWS Credentials
# if: github.repository == 'sonos/tract'
continue-on-error: true
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::567805100031:role/github-runner-tract-ci
aws-region: us-east-2
- name: example tests
env:
AWS_EC2_METADATA_DISABLED: true
timeout-minutes: 30
run: |
cd examples/${{matrix.ex}}
./ci.sh
build-tract-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: cargo build -p tract-cli --profile opt-no-lto
- uses: actions/upload-artifact@v7
with:
name: tract-cli-x86_64
path: ./target/opt-no-lto/tract
build-tract-cli-macos:
runs-on: macOS
steps:
- uses: actions/checkout@v6
- run: cargo build -p tract-cli --profile opt-no-lto
- uses: actions/upload-artifact@v7
with:
name: tract-cli-aarch64-apple
path: ./target/opt-no-lto/tract
gpu-examples:
runs-on: ubuntu-latest
outputs:
examples: ${{steps.set-matrix.outputs.examples}}
steps:
- uses: actions/checkout@v6
- id: set-matrix
run: |
echo examples=`find examples -name ci-gpu.sh | cut -d/ -f 2 | jq -Rsc '. / "\n" - [""]'` >> "$GITHUB_OUTPUT"
gpu-example:
name: ${{ matrix.ex }} (CUDA)
runs-on: cuda-lovelace
needs: [gpu-examples, build-tract-cli]
strategy:
fail-fast: false
matrix:
ex: ${{fromJSON(needs.gpu-examples.outputs.examples)}}
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tract-cli-x86_64
path: target/opt-no-lto
- run: chmod +x target/opt-no-lto/tract
- name: GPU example tests
timeout-minutes: 60
run: |
cd examples/${{matrix.ex}}
./ci-gpu.sh
gpu-example-metal:
name: ${{ matrix.ex }} (Metal)
runs-on: macOS
needs: [gpu-examples, build-tract-cli-macos]
strategy:
fail-fast: false
matrix:
ex: ${{fromJSON(needs.gpu-examples.outputs.examples)}}
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: tract-cli-aarch64-apple
path: target/opt-no-lto
- run: chmod +x target/opt-no-lto/tract
- name: Metal GPU example tests
timeout-minutes: 60
run: |
cd examples/${{matrix.ex}}
./ci-gpu.sh
================================================
FILE: .github/workflows/full.yml
================================================
name: Full test harness
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
pr_number:
description: "Optional PR number to test (from fork ok). Leave empty to run on selected branch."
required: false
type: number
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
test_ref: ${{ steps.set.outputs.test_ref }}
steps:
- id: set
uses: actions/github-script@v8
with:
script: |
const prInput = context.payload.inputs?.pr_number;
core.info(`Fetching PR ${prInput}`);
if (!prInput) {
// Use the ref the workflow was triggered on (branch/tag/SHA in base repo)
core.setOutput('test_ref', process.env.GITHUB_SHA);
return;
}
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: Number(prInput),
});
core.info(pr.data.head.sha);
core.setOutput('test_ref', pr.data.head.sha);
old-harness:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
id-token: write
contents: read
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: Configure AWS Credentials
continue-on-error: true
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::567805100031:role/github-runner-tract-ci
aws-region: us-east-2
- name: Full test
run: .travis/test-harness.sh
cli-tests:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: Full test
env:
AWS_EC2_METADATA_DISABLED: true
run: .travis/cli-tests.sh
onnx-tests:
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
opset: [1_4_1, 1_5_0, 1_6_0, 1_7_0, 1_8_1, 1_9_0, 1_10_2, 1_11_0, 1_12_0, 1_13_0, 1_14_1, 1_15_0, 1_16_2, 1_17_0, 1_18_0, 1_19_1]
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: Full test
run: .travis/onnx-tests.sh ${{ matrix.opset }}
tflite:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: Full test
run: .travis/tflite.sh
some-tests-with-paranoid-asserts:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: With assertions
run: |
rustup update
cargo test --features tract-core/paranoid_assertions -p test-onnx-core -p test-unit-core
without-default-features:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: Without default features
run: |
rustup update
cargo check -p tract-cli --no-default-features $CARGO_EXTRA
complexes:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: With complexes
run: |
rustup update
cargo check -p tract-nnef --features complex $CARGO_EXTRA
check-all-targets:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: Check all targets
run: |
ROOT=$(pwd) ./.travis/ci-system-setup.sh
cargo check --all-targets --workspace --exclude test-metal --exclude tract-metal
C:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: C smoke tests
run: |
cd api/c
cargo install cbindgen
make
python:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.test_ref }}
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Pytest bindings
timeout-minutes: 60
run: |
cd api/py
uv venv --python 3.13
source .venv/bin/activate
uv pip install -e ".[dev]"
pytest .
================================================
FILE: .github/workflows/large_models.yml
================================================
name: Large models
on:
pull_request:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
env:
LARGE_MODELS: true
jobs:
cli:
name: Build tract on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
steps:
- uses: actions/checkout@v6
- run: |
ROOT=. ./.travis/ci-system-setup.sh
cargo build -p tract-cli --profile opt-no-lto --no-default-features --features transformers
- run: echo uname=$(uname) >> $GITHUB_ENV
- uses: actions/upload-artifact@v7
with:
name: tract-cli-${{env.uname}}
path: ./target/opt-no-lto/tract
foundation-llms:
runs-on: ubuntu-latest
outputs:
models: ${{steps.set-matrix.outputs.models}}
q: ${{steps.set-matrix.outputs.q}}
steps:
- id: set-matrix
env:
FULL: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
run: |
if [ "$FULL" = "true" ]
then
echo 'models=[ "openelm-270M", "llama-3.2-1B-instruct", "llama-3.2-3B-instruct", "llama-3.1-8B-instruct", "qwen3-1.7B", "qwen3-8B" ]' >> $GITHUB_OUTPUT
echo 'q=[ "f16f16", "f32f32", "q40ef16" ]' >> $GITHUB_OUTPUT
else
echo ::notice::Skipping most checks on PR and commit. Dispatch workflow manually if needed.
echo 'models=[ "llama-3.2-1B-instruct" ]' >> $GITHUB_OUTPUT
echo 'q=[ "f32f32", "q40ef16" ]' >> $GITHUB_OUTPUT
fi
foundation-llm:
name: ${{ matrix.os }} / ${{matrix.rt}} / ${{ matrix.model }} / ${{ matrix.q }}
needs: [ cli, foundation-llms ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macOS, cuda-lovelace ]
model: ${{fromJson(needs.foundation-llms.outputs.models)}}
q: ${{fromJson(needs.foundation-llms.outputs.q)}}
rt: [ cpu, gpu ]
exclude:
- model: openelm-270M
q: f32f32
- model: Llama-3.2-3B-Instruct
q: f32f32
- model: Llama-3.2-3B-Instruct
q: f32f32
- model: Llama-3.1-8B-Instruct
q: f32f32
- model: Qwen3-1.7B
q: f32f32
- model: Qwen3-8B
q: f32f32
- model: OpenELM-270M
q: f32f32
fail-fast: false
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Configure AWS Credentials
continue-on-error: true
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::567805100031:role/github-runner-tract-ci
aws-region: us-east-2
- run: echo uname=$(uname) >> $GITHUB_ENV
- uses: actions/download-artifact@v8
with:
name: tract-cli-${{env.uname}}
path: tract-cli-${{env.uname}}
- name: Download and run
run: |
chmod +x tract-cli-${{env.uname}}/tract
export TRACT_RUN=$GITHUB_WORKSPACE/tract-cli-${{env.uname}}/tract
if [ "${{matrix.rt}}" = "gpu" ]
then
case $(uname) in
Darwin) RT=metal;;
Linux) RT=cuda;;
esac
fi
.travis/test-llm.sh ${{matrix.model}} ${{matrix.q}} $RT
parakeet-tdt-600m-v3:
name: ${{matrix.os}} / Parakeet TDT 600m v3
needs: [ cli ]
strategy:
matrix:
os: [ macOS, cuda-lovelace ]
fail-fast: false
permissions:
id-token: write
contents: read
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- run: echo uname=$(uname) >> $GITHUB_ENV
- uses: actions/download-artifact@v8
with:
name: tract-cli-${{env.uname}}
path: tract-cli-${{env.uname}}
- name: Download and run
run: |
chmod +x tract-cli-${{env.uname}}/tract
export TRACT_RUN=$GITHUB_WORKSPACE/tract-cli-${{env.uname}}/tract
./harness/parakeet-tdt-600m-v3/ci.sh
================================================
FILE: .github/workflows/pydoc.yml
================================================
name: Python gh-pages doc
on:
pull_request:
release:
workflow_dispatch:
env:
CARGO_INCREMENTAL: false
jobs:
build_doc:
name: Build doc
runs-on: ubuntu-latest
if: github.repository == 'sonos/tract'
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Extract version tag
id: version
if: github.event_name == 'release' && github.event.action == 'published'
run: echo value=$(echo ${{ github.ref }} | cut -f 3 -d / | sed 's/^v//' ) >> $GITHUB_OUTPUT
- name: Build doc
run: |
set -ex
cd api/py
python -m venv pydocs
source pydocs/bin/activate
pip install -r requirements-docs.txt
pip install -e .
sphinx-build -b html . _build/html
cp _static/redirect-index.html _build/html/index.html
- name: Deploy to gh-pages
if: github.event_name != 'pull_request'
run: |
set -ex
git config user.name "CI bot"
git config user.email ci-bot@tract.rs
version="${{ steps.version.outputs.value }}"
if [ -z "$version" ]; then
version="dev"
fi
# fetch existing gh-pages into a work directory
git fetch origin gh-pages --depth=1 || true
workdir=$(mktemp -d)
git worktree add "$workdir" gh-pages 2>/dev/null || {
git worktree add --orphan "$workdir" gh-pages
}
# copy new build into the versioned subdirectory
rm -rf "$workdir/$version"
cp -r api/py/_build/html "$workdir/$version"
# regenerate versions.json (mike-compatible format) from directories present
cd "$workdir"
python3 -c "
import json, os, re
dirs = sorted(
[d for d in os.listdir('.') if os.path.isdir(d) and d != '.git'],
key=lambda v: [int(x) if x.isdigit() else x for x in re.split(r'(\d+)', v)],
reverse=True,
)
versions = [{'version': d, 'title': d, 'aliases': []} for d in dirs]
with open('versions.json', 'w') as f:
json.dump(versions, f, indent=2)
"
# commit and push
git add -A
git commit -m "Update Python docs ($version)" || true
git push origin gh-pages
# clean up worktree
cd -
git worktree remove "$workdir"
================================================
FILE: .github/workflows/release.yml
================================================
on:
push:
tags:
- 'v*'
name: Create release
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Extract version tag
id: version
run: echo value=$(echo ${{ github.ref }} | cut -f 3 -d / | sed 's/^v//' ) >> $GITHUB_OUTPUT
- uses: actions/checkout@v6
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: tract ${{ steps.version.outputs.value }}
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN_RELEASE }}
================================================
FILE: .github/workflows/tract-ci-bench.yml
================================================
name: Bench with tract-ci-minion
on:
schedule:
- cron: '1 * * * *' # every hour at minute 1
workflow_dispatch:
jobs:
minion:
strategy:
fail-fast: false
matrix:
os:
- macOS
- cuda-lovelace
runs-on: ${{ matrix.os }}
steps:
- name: Run minion if found
run: |
if [ -d $HOME/tract-minion ]
then
echo "Running minion"
cd $HOME/tract-minion
./tract-ci-minion --once
else
echo "Not running minion"
fi
================================================
FILE: .github/workflows/wheels.yml
================================================
name: Python wheels
on:
schedule:
- cron: '0 3 * * MON'
release:
types: [created]
workflow_dispatch:
inputs:
publish:
description: force publish to pypi
type: boolean
pypi_version_override:
description: override version id detection
type: string
env:
CARGO_INCREMENTAL: false
PYPI_VERSION_OVERRIDE: ${{ inputs.pypi_version_override }}
CIBW_ENVIRONMENT_PASS_LINUX: "PYPI_VERSION_OVERRIDE"
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
MACOSX_DEPLOYMENT_TARGET: 10.13
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-14]
steps:
- uses: actions/checkout@v6
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install rust toolchains
if: startsWith(matrix.os, 'macOS')
run: rustup target install x86_64-apple-darwin aarch64-apple-darwin
- name: Build wheels
uses: nick-fields/retry@v4
with:
max_attempts: 1
timeout_seconds: 54000 # 15 hours :/
command: uvx cibuildwheel --output-dir wheelhouse api/py
- uses: actions/upload-artifact@v7
with:
name: wheels-${{github.run_id}}-${{matrix.os}}
path: ./wheelhouse/*.whl
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build SDist
run: cd api/py && uv build --sdist
- uses: actions/upload-artifact@v7
with:
name: wheels-${{github.run_id}}-src
path: api/py/dist/*.tar.gz
upload_all:
needs: [build_wheels, make_sdist]
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published') || inputs.publish
steps:
- uses: actions/download-artifact@v8
with:
pattern: wheels-${{github.run_id}}-*
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI }}
verbose: true
================================================
FILE: .github/workflows/windows.yml
================================================
name: Windows unit tests
on:
# pull_request:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
env:
CARGO_INCREMENTAL: false
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
jobs:
windows:
strategy:
matrix:
os: [ windows-2022 ]
toolchain: [ gnu, msvc ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: nick-fields/retry@v4
name: Install Rustup using win.rustup.rs
with:
timeout_minutes: 10
max_attempts: 8
shell: pwsh
command: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --profile=minimal
- uses: nick-fields/retry@v4
name: Install the target
with:
timeout_minutes: 10
max_attempts: 8
shell: pwsh
command: |
rustup toolchain add stable-x86_64-pc-windows-${{matrix.toolchain}}
rustup default stable-x86_64-pc-windows-${{matrix.toolchain}}
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "11.0"
- name: debug
run: dir "C:\\Program Files\\LLVM"
- name: debug lib
run: dir "C:\\Program Files\\LLVM\\lib"
- name: debug bin
run: dir "C:\\Program Files\\LLVM\\bin"
- name: top level cargo check
run: cargo check --workspace --exclude test-blas --exclude tract-metal --exclude test-metal --exclude causal_llm
env:
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\bin"
- name: data / linalg / core / nnef / onnx / onnx-opl
run: cargo test -p tract-data -p tract-linalg -p tract-core -p tract-nnef -p tract-onnx -p tract-onnx-opl
- name: Onnx test suite
run: |
cargo test --release -p test-onnx-core -p test-unit-core
env:
TRACT_LOG: info
================================================
FILE: .gitignore
================================================
target
**/*.rs.bk
*.rustfmt
*.back
Cargo.lock
examples/data
.idea
.cached/**
flamegraph.svg
perf.data*
readings.*
metrics
tract.out
.gdb_history
/issue-*
/.dinghy.toml
.cargo
proptest-regressions
/tmp
wheelhouse
target-bisector*
/nvidia
================================================
FILE: .travis/README.md
================================================
# Travis & minions test infrastructure
## Principles
* travis is triggered on each commit, it will run `./.travis/native.sh` to
perform x86_64 builds, plus a series of `./.travis/cross.sh` for as many
arm boards configurations.
* `.travis/cross.sh` pushes a `.tgz` to a s3 bucket for each configuration. The
bundle contains a `entrypoint.sh` script and anything it depends on,
including the relevant `tract` cli executable. The script is actually names
`bundle-entrypoint.sh` in the repository.
* devices are running `minion.sh` and will pick the new bundles from the s3 bucket,
untar and run the `entrypoint.sh`
## Testing locally
```
cargo build --release -p tract-cli && cargo bench -p tract-linalg --no-run && .travis/run-bundle.sh `.travis/make_bundle.sh`
```
## minion setup
```
MINION=user@hostname.local
scp .travis/minionrc $MINION:.minionrc
scp .travis/minion.sh $MINION:
```
also setup aws credentials (.aws/credentials)
```
apt install wget curl perl awscli screen vim netcat
```
On device: `.minioncrc` set a MINION_ID. At this point, running `./minion.sh`
should work.
## crontab
`crontab -e`
```
*/10 * * * * $HOME/minion.sh
```
## systemd timers
in /etc/systemd/system/minion.service
```
[Unit]
Description=Travis ci bench minion
[Service]
User=root
Type=oneshot
ExecStart=/home/root/minion.sh
```
in /etc/systemd/system/minion.timer
```
[Unit]
Description=Run minion.service every 5 minutes
[Timer]
OnCalendar=*:0/5
[Install]
WantedBy=timers.target
```
then
```
systemctl enable minion.timer
systemctl start minion.timer
```
# Setup file server (http only)
```
sudo apt install nginx awscli vim
```
* setup aws credentials (.aws/credentials)
* in $HOME/sync-data.sh:
```
```
* chmod +x $HOME/sync-data.sh
* run it: ./sync-data.sh
* `crontab -e`
```
*/5 * * * * $HOME/sync-data.sh
```
* `sudo vi /etc/nginx/sites-available/models`
```
server {
root /home/raspbian/models/;
location /models {
}
}
```
* `sudo ln -s /etc/nginx/sites-available/models /etc/nginx/sites-enabled/`
* `sudo rm /etc/nginx/sites-enabled/default`
* `sudo /etc/init.d/nginx reload`
* test : `curl -I http://localhost/hey_snips_v1.pb`
================================================
FILE: .travis/android-ndk.sh
================================================
#!/bin/sh
set -ex
which java || sudo apt install -y default-jdk
ANDROID_SDK=$HOME/cached/android-sdk
if [ ! -d "$ANDROID_SDK" ]
then
mkdir -p $ANDROID_SDK
cd $ANDROID_SDK
# ANDROID_SDK_VERSION=4333796
# "https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip"
curl -s -o android-sdk.zip \
https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip
unzip -q android-sdk.zip
rm android-sdk.zip
fi
yes | $ANDROID_SDK/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK --licenses > /dev/null
$ANDROID_SDK/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK \
"build-tools;30.0.0" "platform-tools" "platforms;android-31" "tools" "ndk-bundle" \
> /dev/null
================================================
FILE: .travis/asan.sh
================================================
#!/bin/sh
set -ex
# RUSTFLAGS=-Zsanitizer=address cargo +nightly test -Zbuild-std --target $(rustc -vV | sed -n 's|host: ||p')
TARGET=$(rustc -vV | sed -n 's|host: ||p')
rustup toolchain add nightly
rustup component add rust-src --toolchain nightly-$TARGET
export RUSTFLAGS=-Zsanitizer=address
export RUSTDOCFLAGS=$RUSTFLAGS
export RUSTUP_TOOLCHAIN=nightly
export RUST_VERSION=nightly
export CARGO_EXTRA="--target $TARGET"
cargo -q test -q -p tract-linalg $CARGO_EXTRA
# inventory, asan and macos liner are not playing nice, so we have to stop there
if [ $(uname) == "Darwin" ]
then
exit 0
fi
cargo -q test -q -p tract-core --features paranoid_assertions $CARGO_EXTRA
./.travis/regular-tests.sh
if [ -n "$CI" ]
then
cargo clean
fi
./.travis/onnx-tests.sh
if [ -n "$CI" ]
then
cargo clean
fi
./.travis/cli-tests.sh
================================================
FILE: .travis/bundle-entrypoint.sh
================================================
#!/bin/sh
set -ex
start=$(date +%s)
ROOT=`pwd`
if [ -n "$TRACT_RUN" ]
then
TRACT=$TRACT_RUN
elif [ -x tract ]
then
TRACT="./tract"
else
cargo build -p tract-cli -q --release
TRACT="./target/release/tract"
fi
CACHEDIR=${CACHEDIR:-$HOME/.cache/tract-ci-minion-models}
case $CACHEDIR in
"http"*)
wget $CACHEDIR/private/private-benches.sh
PRIVATE=`pwd`/private-benches.sh
;;
*)
[ -d $CACHEDIR ] || mkdir $CACHEDIR
PATH=$PATH:/usr/local/bin # for aws command on darwin
aws s3 sync s3://tract-ci-builds/model $CACHEDIR || echo "Warning: aws s3 sync failed, continuing with cached models"
(cd $CACHEDIR
[ -d en_libri_real ] || tar zxf en_libri_real.tar.gz
[ -d en_tdnn_lstm_bn_q7 ] || tar zxf en_tdnn_lstm_bn_q7.tar.gz
)
PRIVATE=$CACHEDIR/private/private-benches.sh
;;
esac
touch metrics
if [ -e sizes ]
then
cat sizes >> metrics
fi
if [ $(uname) = "Linux" ]
then
if [ -r /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor -a `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` = "userspace" ]
then
F=$(printf "%s\n" `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies` | sort -n | tail -1)
echo $F > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
fi
fi
net_bench() {
net=$1
pb=$2
shift 2
$TRACT "$@" --machine-friendly -O bench --allow-random-input $BENCH_OPTS > tract.out
v=`cat tract.out | grep -a real | cut -f 2 -d ' ' | sed 's/\([0-9]\{9,9\}\)[0-9]*/\1/'`
echo net.$net.evaltime.$pb $v >> metrics
$TRACT "$@" --readings --readings-heartbeat 1000 --machine-friendly -O bench --allow-random-input $BENCH_OPTS > tract.out
for stage in model_ready before_optimize
do
pattern=$(echo $stage | sed 's/[_-]/./g')
v=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 1 -d ' ')
echo net.$net.time_to_$stage.$pb $v >> metrics
v=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 4 -d ' ')
echo net.$net.rsz_at_$stage.$pb $v >> metrics
f=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 11 -d ' ')
a=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 10 -d ' ')
echo net.$net.active_at_$stage.$pb $(($a-$f)) >> metrics
done
}
llm_bench() {
net=$1
pb=$2
shift 2
if $TRACT "$@" --llm --machine-friendly -O llm-bench $BENCH_OPTS > tract.out
then
cat tract.out
echo llm.$net.pp512.$pb $(cat tract.out | grep -a PP512 | cut -f 2 -d ' ') >> metrics
echo llm.$net.tg128.$pb $(cat tract.out | grep -a TG128 | cut -f 2 -d ' ') >> metrics
fi
if $TRACT "$@" --readings --readings-heartbeat 1000 --llm --machine-friendly -O llm-bench $BENCH_OPTS > /dev/null
then
for stage in model_ready before_optimize
do
pattern=$(echo $stage | sed 's/[_-]/./g')
v=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 1 -d ' ')
echo llm.$net.time_to_$stage.$pb $v >> metrics
v=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 4 -d ' ')
echo llm.$net.rsz_at_$stage.$pb $v >> metrics
f=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 11 -d ' ')
a=$(grep -a $pattern readings.out | sed 's/ */ /g;s/^ *//' | cut -f 10 -d ' ')
if [ -n "$a" -a -n "$f" ]
then
echo llm.$net.active_at_$stage.$pb $(($a-$f)) >> metrics
fi
done
fi
}
net_bench arm_ml_kws_cnn_m pass $CACHEDIR/ARM-ML-KWS-CNN-M.pb -i 49,10,f32 --partial --input-node Mfcc
net_bench hey_snips_v1 400ms $CACHEDIR/hey_snips_v1.pb -i 80,40,f32
net_bench hey_snips_v31 400ms $CACHEDIR/hey_snips_v3.1.pb -i 40,40,f32
net_bench hey_snips_v4_model17 2sec $CACHEDIR/hey_snips_v4_model17.pb -i 200,20,f32
net_bench hey_snips_v4_model17 pulse8 $CACHEDIR/hey_snips_v4_model17.pb -i S,20,f32 --pulse 8
net_bench hey_snips_v4_model17_nnef pulse8 --nnef-tract-pulse $CACHEDIR/hey_snips_v4_model17.alpha1.tar
net_bench mobilenet_v1_1 pass $CACHEDIR/mobilenet_v1_1.0_224_frozen.pb -i 1,224,224,3,f32
net_bench mobilenet_v2_1 pass $CACHEDIR/mobilenet_v2_1.4_224_frozen.pb -i 1,224,224,3,f32
net_bench inceptionv1q pass $CACHEDIR/inceptionv1_quant.nnef.tar.gz --nnef-tract-core
net_bench inceptionv3 pass $CACHEDIR/inception_v3_2016_08_28_frozen.pb -i 1,299,299,3,f32
net_bench mdl-en-2019-Q3-librispeech_onnx 2600ms $CACHEDIR/en_libri_real/model.onnx --output-node output -i 264,40
net_bench mdl-en-2019-Q3-librispeech_onnx pulse_240ms $CACHEDIR/en_libri_real/model.onnx --output-node output -i S,40 --pulse 24
net_bench en_tdnn_lstm_bn_q7 2600ms $CACHEDIR/en_tdnn_lstm_bn_q7/model.onnx --output-node output -i 264,40
net_bench en_tdnn_lstm_bn_q7 pulse_240ms $CACHEDIR/en_tdnn_lstm_bn_q7/model.onnx --output-node output -i S,40 --pulse 24
net_bench en_tdnn_8M 2600ms $CACHEDIR/mdl-en-2019-12-24-aho-corasick-18h01m33s.onnx --output-node output -i 264,40
net_bench en_tdnn_8M pulse_240ms $CACHEDIR/mdl-en-2019-12-24-aho-corasick-18h01m33s.onnx --output-node output -i S,40 --pulse 24
net_bench en_tdnn_8M pulse_180ms $CACHEDIR/mdl-en-2019-12-24-aho-corasick-18h01m33s.onnx --output-node output -i S,40 --pulse 18
net_bench en_tdnn_8M pulse_120ms $CACHEDIR/mdl-en-2019-12-24-aho-corasick-18h01m33s.onnx --output-node output -i S,40 --pulse 12
net_bench en_tdnn_8M_nnef pulse_240ms $CACHEDIR/mdl-en-2019-12-24-aho-corasick-18h01m33s.alpha1.a.tar --nnef-tract-pulse
net_bench en_tdnn_15M 2600ms $CACHEDIR/en_tdnn_15M.onnx --output-node output -i 264,40
net_bench en_tdnn_15M pulse_240ms $CACHEDIR/en_tdnn_15M.onnx --output-node output -i S,40 --pulse 24
net_bench en_tdnn_15M pulse_120ms $CACHEDIR/en_tdnn_15M.onnx --output-node output -i S,40 --pulse 12
net_bench en_tdnn_15M_nnef pulse_240ms $CACHEDIR/en_tdnn_15M.alpha1.tar --nnef-tract-pulse
net_bench dummy-conmer-12M pulse_120ms $CACHEDIR/dummy-conmer-12M.nnef.tar --nnef-tract-core --pulse 12
net_bench en_tdnn_pyt_15M pulse_120ms $CACHEDIR/mdl-en-2023-03-27-allen-17h11m50s.nnef.tar --nnef-tract-core --pulse 12
net_bench speaker_id pulse8 $CACHEDIR/speaker-id-2019-03.onnx -i 1,S,40,f32 --output-node 257 --partial --pulse 8
net_bench voicecom_fake_quant 2sec $CACHEDIR/snips-voice-commands-cnn-fake-quant.pb -i 200,10,f32
net_bench voicecom_float 2sec $CACHEDIR/snips-voice-commands-cnn-float.pb -i 200,10,f32
net_bench trunet pulse1_f32 $CACHEDIR/trunet_dummy.nnef.tgz --nnef-tract-core --pulse 1
net_bench trunet pulse1_f16 $CACHEDIR/trunet_dummy.nnef.tgz --nnef-tract-core -t f32_to_f16 --pulse 1
. $PRIVATE
if [ $(uname) = "Darwin" ]
then
LLM_BACKENDS="cpu metal"
fi
if which nvidia-smi
then
LLM_BACKENDS="cpu cuda"
fi
if [ -n "$LLM_BACKENDS" ]
then
for backend in $LLM_BACKENDS
do
case $backend in
cpu) extra="--timeout 180";;
metal) extra="--metal --timeout 60"
BENCH_OPTS="--warmup-loops 1"
;;
cuda) extra="--cuda --timeout 60"
BENCH_OPTS="--warmup-loops 1"
;;
esac
llm_bench llama-3_2-1B-q40ef32-516 $backend $CACHEDIR/Llama-3.2-1B-q40ef32.516.nnef.tgz $extra
llm_bench openelm-270M-q40ef16-516 $backend $CACHEDIR/OpenELM-270M-q40ef16.516.nnef.tgz $extra
llm_bench llama-3_2-1B-instruct-q40ef16-541 $backend $CACHEDIR/Llama-3.2-1B-Instruct-q40ef16.541.nnef.tgz $extra
llm_bench openelm-270M-q40ef16-541 $backend $CACHEDIR/OpenELM-270M-q40ef16.541.nnef.tgz $extra
net_bench parakeet-tdt-600m-v3-f32f32-preprocessor_1s $backend $CACHEDIR/parakeet-tdt-0.6b-v3-f32f32.608.preprocessor.nnef.tgz \
-t transformers_detect_all --nnef-tract-transformers --set B=1 --set A=16000 $extra
net_bench parakeet-tdt-600m-v3-f32f32-encoder_1s $backend $CACHEDIR/parakeet-tdt-0.6b-v3-f32f32.608.encoder.p1.nnef.tgz \
-t transformers_detect_all --nnef-tract-transformers --set B=1 --set S=100 $extra
net_bench parakeet-tdt-600m-v3-f32f32-decoder_pass $backend $CACHEDIR/parakeet-tdt-0.6b-v3-f32f32.608.decoder.nnef.tgz \
-t transformers_detect_all --nnef-tract-transformers --set B=1 --set T=1 $extra
net_bench parakeet-tdt-600m-v3-f32f32-joint_pass $backend $CACHEDIR/parakeet-tdt-0.6b-v3-f32f32.608.joint.nnef.tgz \
-t transformers_detect_all --nnef-tract-transformers --set B=1 --set R=1 --set U=1 $extra
if [ "$backend" != "cpu" ]
then
llm_bench llama-3_2-3B-q40ef32-516 $backend $CACHEDIR/Llama-3.2-3B-q40ef32.516.nnef.tgz $extra
llm_bench llama-3_1-8B-instruct-q40ef16-541 $backend $CACHEDIR/Llama-3.1-8B-Instruct-q40ef16.541.nnef.tgz $extra
llm_bench llama-3_2-3B-instruct-q40ef16-541 $backend $CACHEDIR/Llama-3.2-3B-Instruct-q40ef16.541.nnef.tgz $extra
llm_bench qwen3-1_7B-q40ef16-541 $backend $CACHEDIR/Qwen3-1.7B-q40ef16.541.nnef.tgz $extra
fi
done
fi
end=$(date +%s)
echo bundle.bench-runtime $(($end - $start)) >> metrics
================================================
FILE: .travis/cache_file.sh
================================================
#!/bin/sh
set -e
if [ -z "$CACHEDIR" ]
then
CACHEDIR=`dirname $0`/../.cached
fi
mkdir -p $CACHEDIR
cd $CACHEDIR
for file in $@
do
mkdir -p $(dirname $file)
if [ ! -e $file ]
then
wget --no-verbose https://s3.amazonaws.com/tract-ci-builds/tests/$file -O $file.tmp \
|| aws s3 cp s3://tract-ci-builds/tests/$file $file.tmp
mv $file.tmp $file
fi
done
exit 0
================================================
FILE: .travis/cargo-deny-check.sh
================================================
#!/bin/sh
if [ -e cargo-deny ]
then
CARGO_DENY=`pwd`/cargo-deny
else
CARGO_DENY="cargo deny"
fi
(cd api/rs ; $CARGO_DENY check)
================================================
FILE: .travis/ci-system-setup.sh
================================================
#!/bin/sh
set -e
[ -d $ROOT/.travis ] || exit 1 "\$ROOT not set correctly '$ROOT'"
if [ -z "$RUSTUP_TOOLCHAIN" ]
then
export RUSTUP_TOOLCHAIN=1.91.0
fi
export RUSTUP_TOOLCHAIN
PATH=$PATH:$HOME/.cargo/bin
if [ -n "$CI" -a ! -e /tmp/ci-setup-done ]
then
if [ `uname` = "Darwin" ]
then
sysctl -n machdep.cpu.brand_string
python3 --version
brew install coreutils numpy python-setuptools jshon
PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
export PYTHON_BIN_PATH=python3
else
if [ "$RUNNER_ENVIRONMENT" != "self-hosted" ]
then
if [ `whoami` != "root" ]
then
SUDO=sudo
fi
$SUDO apt-get update
# $SUDO apt-get upgrade -y
$SUDO apt-get install -y llvm python3 python3-numpy jshon wget curl build-essential sudo jshon clang
if ! which aws
then
curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip
$SUDO apt-get install -y unzip
unzip -q awscliv2.zip
$SUDO ./aws/install
aws --version
fi
fi
fi
which rustup || curl https://sh.rustup.rs -sSf | sh -s -- -y
rustup update
rustup toolchain add $RUSTUP_TOOLCHAIN
[ -n "$GITHUB_PATH" ] && echo $HOME/.cargo/bin >> $GITHUB_PATH
touch /tmp/ci-setup-done
fi
S3=https://s3.amazonaws.com/tract-ci-builds/tests
if [ -n "$LARGE_MODELS" ]
then
export CACHE_FILE=$ROOT/.travis/cache_file.sh
export MODELS=$HOME/.cache/models
export CACHEDIR=$MODELS
mkdir -p $MODELS
elif [ -n "$CI" ]
then
MODELS=$S3
CACHE_FILE=true
else
CACHE_FILE=$ROOT/.travis/cache_file.sh
MODELS=${MODELS:-$ROOT/.cached}
mkdir -p $MODELS
fi
if [ -z "$TRACT_RUN" ]
then
TRACT_RUN="cargo run -p tract-cli $CARGO_EXTRA --profile opt-no-lto --no-default-features --features transformers,pulse --"
export TRACT_RUN
fi
TRACT_RUNTIMES="-O"
if [ "$(uname)" = "Darwin" ] && (system_profiler SPDisplaysDataType | grep -i "Metal")
then
TRACT_RUNTIMES="$TRACT_RUNTIMES --metal"
fi
if which nvidia-smi
then
TRACT_RUNTIMES="$TRACT_RUNTIMES --cuda"
fi
echo $TRACT_RUNTIMES
================================================
FILE: .travis/cli-tests.sh
================================================
#!/bin/sh
WHITE='\033[1;37m'
NC='\033[0m' # No Color
set -e
ROOT=$(dirname $(dirname $(realpath $0)))
. $ROOT/.travis/ci-system-setup.sh
echo
echo $WHITE • build tract $NC
echo
TRACT_RUN=$(cargo build --message-format json -p tract-cli $CARGO_EXTRA --profile opt-no-lto | jq -r 'select(.target.name == "tract" and .executable).executable')
echo TRACT_RUN=$TRACT_RUN
export TRACT_RUN
echo
echo $WHITE • harness/nnef-test-cases $NC
echo
for t in `find harness/nnef-test-cases -name runme.sh`
do
echo $WHITE$t$NC
$t
done
echo
echo $WHITE • onnx/test_cases $NC
echo
# ( cd onnx/test_cases ; CACHEDIR=$MODELS ./run_all.sh )
echo
echo $WHITE • full models command line test cases $NC
echo
echo $WHITE image $NC
$CACHE_FILE squeezenet.onnx
$TRACT_RUN $MODELS/squeezenet.onnx -O \
run -q \
--allow-random-input \
--assert-output-fact 1,1000,1,1,f32
$CACHE_FILE inception_v3_2016_08_28_frozen.pb
$TRACT_RUN \
$MODELS/inception_v3_2016_08_28_frozen.pb \
-i 1,299,299,3,f32 -O \
run -q \
--allow-random-input \
--assert-output-fact 1,1001,f32
$TRACT_RUN \
$MODELS/inception_v3_2016_08_28_frozen.pb \
-i 1,299,299,3,f32 -O \
run -q \
--allow-random-input \
--assert-output-fact 1,1001,f32
$CACHE_FILE mobilenet_v1_1.0_224_frozen.pb
$TRACT_RUN $MODELS/mobilenet_v1_1.0_224_frozen.pb \
-O -i 1,224,224,3,f32 \
run -q \
--allow-random-input \
--assert-output-fact 1,1001,f32
$CACHE_FILE mobilenet_v2_1.4_224_frozen.pb
$TRACT_RUN $MODELS/mobilenet_v2_1.4_224_frozen.pb \
-O -i 1,224,224,3,f32 \
run -q \
--allow-random-input \
--assert-output-fact 1,1001,f32
$CACHE_FILE inceptionv1_quant.nnef.tar.gz inceptionv1_quant.io.npz
$TRACT_RUN $MODELS/inceptionv1_quant.nnef.tar.gz \
--nnef-tract-core \
--input-facts-from-bundle $MODELS/inceptionv1_quant.io.npz -O \
run \
--input-from-bundle $MODELS/inceptionv1_quant.io.npz \
--allow-random-input \
--assert-output-bundle $MODELS/inceptionv1_quant.io.npz
echo $WHITE audio $NC
$CACHE_FILE ARM-ML-KWS-CNN-M.pb
$TRACT_RUN $MODELS/ARM-ML-KWS-CNN-M.pb \
-O -i 49,10,f32 --partial \
--input-node Mfcc \
run -q \
--allow-random-input
$CACHE_FILE GRU128KeywordSpotter-v2-10epochs.onnx
$TRACT_RUN $MODELS/GRU128KeywordSpotter-v2-10epochs.onnx \
-O run -q \
--allow-random-input \
--assert-output-fact 1,3,f32
$CACHE_FILE mdl-en-2019-Q3-librispeech.onnx
$TRACT_RUN $MODELS/mdl-en-2019-Q3-librispeech.onnx \
-O -i S,40,f32 --output-node output --pulse 24 \
run -q \
--allow-random-input
$CACHE_FILE hey_snips_v4_model17.pb
$TRACT_RUN $MODELS/hey_snips_v4_model17.pb \
-i S,20,f32 --pulse 8 dump --cost -q \
--assert-cost "FMA(F32)=2060448,Div(F32)=24576,Buffer(F32)=2920,Params(F32)=222251"
$TRACT_RUN $MODELS/hey_snips_v4_model17.pb -i S,20,f32 \
dump -q \
--assert-op-count AddAxis 0
$CACHE_FILE trunet_dummy.nnef.tgz
$TRACT_RUN --nnef-tract-core $MODELS/trunet_dummy.nnef.tgz dump -q
echo $WHITE LLM $NC
TEMP_ELM=$(mktemp -d)
$CACHE_FILE 2024_06_25_elm_micro_export_with_kv_cache.nnef.tgz
$TRACT_RUN $MODELS/2024_06_25_elm_micro_export_with_kv_cache.nnef.tgz \
--nnef-tract-core \
--assert "S>0" --assert "P>0" --assert "S+P<2048" \
dump -q --nnef $TEMP_ELM/with-asserts.nnef.tgz
$TRACT_RUN --nnef-tract-core $TEMP_ELM/with-asserts.nnef.tgz dump -q
rm -rf $TEMP_ELM
for t in harness/pre-optimized-graphes/*
do
( cd $t ; ./runme.sh)
done
(
if aws s3 ls tract-ci-builds/model/private
then
echo
echo $WHITE • private tests $NC
echo
if [ -n "$CI" ]
then
OUTPUT=/dev/null
else
set -x
OUTPUT=/dev/stdout
fi
(
mkdir -p $CACHEDIR
cd $CACHEDIR
aws s3 sync s3://tract-ci-builds/model/private private
for t in `find private -name t.sh`
do
( cd `dirname $t` ; sh ./t.sh )
done
) 2>&1 > $OUTPUT
echo
echo $WHITE • benches on full models $NC
echo
./.travis/bundle-entrypoint.sh
fi
)
================================================
FILE: .travis/cost_model_task_build.sh
================================================
#!/bin/sh
set -ex
ARCH=$1
ID=$2
case $ARCH in
aarch64)
MUSL_TRIPLE=aarch64-linux-musl
RUST_TRIPLE=aarch64-unknown-linux-musl
PLATFORM=aarch64-unknown-linux-musl
;;
armv7)
MUSL_TRIPLE=armv7l-linux-musleabihf
RUST_TRIPLE=armv7-unknown-linux-musleabihf
PLATFORM=armv7-unknown-linux-musl
;;
*)
exit "Can't build with musl for $ARCH"
;;
esac
rustup update
rustup target add $RUST_TRIPLE
#curl -s https://musl.cc/${MUSL_TRIPLE}-cross.tgz | tar zx
curl -s https://s3.amazonaws.com/tract-ci-builds/toolchains/${MUSL_TRIPLE}-cross.tgz | tar zx
MUSL_BIN=`pwd`/${MUSL_TRIPLE}-cross/bin
export PATH=$MUSL_BIN:$PATH
export TARGET_CC=$MUSL_BIN/${MUSL_TRIPLE}-gcc
RUST_TRIPLE_ENV=$(echo $RUST_TRIPLE | tr 'a-z-' 'A-Z_')
export CARGO_TARGET_${RUST_TRIPLE_ENV}_CC=$TARGET_CC
export CARGO_TARGET_${RUST_TRIPLE_ENV}_LINKER=$TARGET_CC
( cd linalg/cost_model ; cargo build --target $RUST_TRIPLE --release )
TASK_NAME=cost-model-dataset-$ID
mkdir $TASK_NAME
mv linalg/cost_model/target/${RUST_TRIPLE}/release/cost_model $TASK_NAME
echo "export TIMEOUT=$((86400*4))" > $TASK_NAME/vars
echo "#!/bin/sh" > $TASK_NAME/entrypoint.sh
echo "mkdir product" >> $TASK_NAME/entrypoint.sh
echo "./cost_model ds --size 10000 product/$TASK_NAME.txt" >> $TASK_NAME/entrypoint.sh
# echo "./cost_model ds --size 2000 -k 128 -n 16 product/$TASK_NAME-small-k-tiny-n.txt" >> $TASK_NAME/entrypoint.sh
# echo "./cost_model ds --size 5000 -m 1-512 -k 16,64,256 -n 1-20 product/$TASK_NAME-multiple-k-tiny-n.txt" >> $TASK_NAME/entrypoint.sh
# echo "./cost_model ds --size 1000 -m 1-512 -k 256,1024 -n 1-512 product/$TASK_NAME-bigmn" >> $TASK_NAME/entrypoint.sh
chmod +x $TASK_NAME/entrypoint.sh
tar czf $TASK_NAME.tgz $TASK_NAME
if [ -n "$AWS_ACCESS_KEY_ID" ]
then
aws s3 cp $TASK_NAME.tgz s3://tract-ci-builds/tasks/$PLATFORM/$TASK_NAME.tgz
fi
================================================
FILE: .travis/cross.sh
================================================
#!/bin/sh
set -ex
ROOT=$(dirname $(dirname $(realpath $0)))
. $ROOT/.travis/ci-system-setup.sh
which cargo-dinghy || ( mkdir -p /tmp/cargo-dinghy
if [ `arch` = x86_64 -o `arch` = i386 -o `arch` = arm64 ]
then
cd /tmp/cargo-dinghy
if [ `uname` = "Darwin" ]
then
NAME=macos
else
NAME=linux
fi
VERSION=0.8.0
wget -q https://github.com/snipsco/dinghy/releases/download/$VERSION/cargo-dinghy-$NAME-$VERSION.tgz -O cargo-dinghy.tgz
tar vzxf cargo-dinghy.tgz --strip-components 1
mv cargo-dinghy $HOME/.cargo/bin
else
cargo install cargo-dinghy
fi
)
if [ -z "$PLATFORM" -a -n "$1" ]
then
PLATFORM=$1
fi
case "$PLATFORM" in
"raspbian")
[ -e $HOME/cached/raspitools ] || git clone --depth 1 https://github.com/raspberrypi/tools $HOME/cached/raspitools
TOOLCHAIN=$HOME/cached/raspitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf
export RUSTC_TRIPLE=arm-unknown-linux-gnueabihf
rustup target add $RUSTC_TRIPLE
echo "[platforms.$PLATFORM]\nrustc_triple='$RUSTC_TRIPLE'\ntoolchain='$TOOLCHAIN'" > .dinghy.toml
cargo dinghy --platform $PLATFORM build --release -p tract-cli -p example-tensorflow-mobilenet-v2 -p tract-ffi
;;
"aarch64-linux-android"|"armv7-linux-androideabi"|"i686-linux-android"|"x86_64-linux-android")
case "$PLATFORM" in
"aarch64-linux-android")
ANDROID_CPU=aarch64
RUSTC_TRIPLE=aarch64-linux-android
;;
"armv7-linux-androideabi")
ANDROID_CPU=armv7
RUSTC_TRIPLE=armv7-linux-androideabi
;;
"i686-linux-android")
ANDROID_CPU=i686
RUSTC_TRIPLE=i686-linux-android
;;
"x86_64-linux-android")
ANDROID_CPU=x86_64
RUSTC_TRIPLE=x86_64-linux-android
;;
esac
export TARGET_AR=ar
if [ -e /usr/local/lib/android/sdk/ndk-bundle ]
then
export ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk-bundle
else
export ANDROID_SDK_HOME=$HOME/cached/android-sdk
[ -e $ANDROID_SDK_HOME ] || ./.travis/android-ndk.sh
fi
rustup target add $RUSTC_TRIPLE
cargo dinghy --platform auto-android-$ANDROID_CPU build -p tract-linalg -p tract-ffi
;;
"aarch64-apple-ios")
rustup target add aarch64-apple-ios
cargo dinghy --platform auto-ios-aarch64 check -p tract-linalg -p tract-ffi
;;
"aarch64-apple-darwin" | "x86_64-unknown-linux-gnu")
RUSTC_TRIPLE=$PLATFORM
rustup target add $RUSTC_TRIPLE
cargo build --target $RUSTC_TRIPLE -p tract-cli --release
;;
"aarch64-unknown-linux-gnu-stretch" | "armv7-unknown-linux-gnueabihf-stretch" | "x86_64-unknown-linux-gnu-stretch")
INNER_PLATFORM=${PLATFORM%-stretch}
(cd .travis/docker-debian-stretch; docker build --tag debian-stretch .)
docker run -v `pwd`:/tract -w /tract \
-e CI=true \
-e SKIP_QEMU_TEST=skip \
-e PLATFORM=$INNER_PLATFORM debian-stretch \
./.travis/cross.sh
sudo chown -R `whoami` .
export RUSTC_TRIPLE=$INNER_PLATFORM
;;
"aarch64-unknown-linux-gnu" | "armv6vfp-unknown-linux-gnueabihf" | "armv7-unknown-linux-gnueabihf" | \
"aarch64-unknown-linux-musl" | "armv7-unknown-linux-musl" | "cortexa53-unknown-linux-musl" )
case "$PLATFORM" in
"aarch64-unknown-linux-gnu")
export ARCH=aarch64
export QEMU_ARCH=aarch64
export LIBC_ARCH=arm64
export TRACT_CPU_AARCH64_KIND=a55
export RUSTC_TRIPLE=$ARCH-unknown-linux-gnu
export DEBIAN_TRIPLE=$ARCH-linux-gnu
;;
"armv6vfp-unknown-linux-gnueabihf")
export ARCH=armv6vfp
export LIBC_ARCH=armhf
export QEMU_ARCH=arm
export QEMU_OPTS="-cpu cortex-a15"
export RUSTC_TRIPLE=arm-unknown-linux-gnueabihf
export DEBIAN_TRIPLE=arm-linux-gnueabihf
;;
"armv7-unknown-linux-gnueabihf")
export ARCH=armv7
export QEMU_ARCH=arm
export LIBC_ARCH=armhf
export QEMU_OPTS="-cpu cortex-a15"
export RUSTC_TRIPLE=armv7-unknown-linux-gnueabihf
export DEBIAN_TRIPLE=arm-linux-gnueabihf
export TARGET_CC=$DEBIAN_TRIPLE-gcc
export TRACT_CPU_ARM32_NEON=true
export DINGHY_TEST_ARGS="--env TRACT_CPU_ARM32_NEON=true"
;;
"aarch64-unknown-linux-musl")
export ARCH=aarch64
export QEMU_ARCH=aarch64
export LIBC_ARCH=arm64
export RUSTC_TRIPLE=$ARCH-unknown-linux-musl
export DEBIAN_TRIPLE=$ARCH-linux-gnu
export TRACT_CPU_AARCH64_KIND=a55
export CUSTOM_TC=`pwd`/aarch64-linux-musl-cross
[ -d "$CUSTOM_TC" ] || curl -s https://s3.amazonaws.com/tract-ci-builds/toolchains/aarch64-linux-musl-cross.tgz | tar zx
;;
"cortexa53-unknown-linux-musl")
export ARCH=aarch64
export QEMU_ARCH=aarch64
export LIBC_ARCH=arm64
export RUSTC_TRIPLE=$ARCH-unknown-linux-musl
export DEBIAN_TRIPLE=$ARCH-linux-gnu
export TRACT_CPU_AARCH64_KIND=a53
export QEMU_OPTS="-cpu cortex-a53"
export CUSTOM_TC=`pwd`/aarch64-linux-musl-cross
[ -d "$CUSTOM_TC" ] || curl -s https://s3.amazonaws.com/tract-ci-builds/toolchains/aarch64-linux-musl-cross.tgz | tar zx
;;
"armv7-unknown-linux-musl")
export ARCH=armv7
export QEMU_ARCH=arm
export LIBC_ARCH=armhf
export RUSTC_TRIPLE=armv7-unknown-linux-musleabihf
export DEBIAN_TRIPLE=arm-linux-gnueabihf
export CUSTOM_TC=`pwd`/armv7l-linux-musleabihf-cross
export TRACT_CPU_ARM32_NEON=true
export DINGHY_TEST_ARGS="--env TRACT_CPU_ARM32_NEON=true"
[ -d "$CUSTOM_TC" ] || curl -s https://s3.amazonaws.com/tract-ci-builds/toolchains/armv7l-linux-musleabihf-cross.tgz | tar zx
export TARGET_CFLAGS="-mfpu=neon"
;;
*)
echo "unsupported platform $PLATFORM"
exit 1
;;
esac
mkdir -p $ROOT/target/$RUSTC_TRIPLE
echo "[platforms.$PLATFORM]\nrustc_triple='$RUSTC_TRIPLE'" > .dinghy.toml
if [ -n "$DEBIAN_TRIPLE" ]
then
PACKAGES="$PACKAGES binutils-$DEBIAN_TRIPLE gcc-$DEBIAN_TRIPLE libc6-dev-$LIBC_ARCH-cross"
echo "deb_multiarch='$DEBIAN_TRIPLE'" >> .dinghy.toml
fi
if [ -n "$CUSTOM_TC" ]
then
echo "toolchain='$CUSTOM_TC'" >> .dinghy.toml
fi
echo "[script_devices.qemu-$PLATFORM]\nplatform='$PLATFORM'\npath='$ROOT/target/$RUSTC_TRIPLE/qemu-$PLATFORM'" >> .dinghy.toml
echo "#!/bin/sh\nexe=\$1\nshift\n/usr/bin/qemu-$QEMU_ARCH $QEMU_OPTS -L /usr/$DEBIAN_TRIPLE/ \$exe --test-threads 1 \"\$@\"" > $ROOT/target/$RUSTC_TRIPLE/qemu-$PLATFORM
chmod +x $ROOT/target/$RUSTC_TRIPLE/qemu-$PLATFORM
DINGHY_TEST_ARGS="$DINGHY_TEST_ARGS --env PROPTEST_MAX_SHRINK_ITERS=100000000"
$SUDO apt-get -y install --no-install-recommends qemu-system-arm qemu-user libssl-dev pkg-config $PACKAGES
rustup target add $RUSTC_TRIPLE
if [ -z "$SKIP_QEMU_TEST" ]
then
qemu-$QEMU_ARCH --version
cargo dinghy --platform $PLATFORM $DINGHY_TEST_ARGS test --profile opt-no-lto -p tract-linalg -- --nocapture
cargo dinghy --platform $PLATFORM $DINGHY_TEST_ARGS test --profile opt-no-lto -p tract-core
fi
cargo dinghy --platform $PLATFORM $DINGHY_TEST_ARGS check -p tract-ffi
# keep lto for these two are they're going to devices.
cargo dinghy --platform $PLATFORM build --release -p tract-cli -p example-tensorflow-mobilenet-v2
;;
wasm32-wasi)
PLATFORM=wasm32-wasip1
wasmtime --version
rustup target add $PLATFORM
cargo check --target $PLATFORM --features getrandom-js -p tract-onnx -p tract-tensorflow
RUSTFLAGS='-C target-feature=+simd128' CARGO_TARGET_WASM32_WASIP1_RUNNER=wasmtime \
cargo test --target=$PLATFORM -p tract-linalg -p tract-core -p test-unit-core
;;
wasm32-*)
rustup target add $PLATFORM
cargo check --target $PLATFORM --features getrandom-js -p tract-onnx -p tract-tensorflow
;;
*)
echo "Don't know what to do for platform: $PLATFORM"
exit 2
;;
esac
if [ -e "target/$RUSTC_TRIPLE/release/tract" ]
then
export RUSTC_TRIPLE
TASK_NAME=`.travis/make_bundle.sh`
echo bench task: $TASK_NAME
if [ -n "$AWS_ACCESS_KEY_ID" ]
then
aws s3 cp $TASK_NAME.tgz s3://tract-ci-builds/tasks/$PLATFORM/$TASK_NAME.tgz
fi
fi
================================================
FILE: .travis/debug-tests.sh
================================================
#!/bin/sh
set -ex
if [ -z "$CACHEDIR" ]
then
CACHEDIR=`dirname $0`/../.cached
fi
# useful as debug_asserts will come into play
cargo test -p tract-core
cargo test -p test-onnx-core -p test-nnef-cycle -p test-unit-core
================================================
FILE: .travis/docker-debian-stretch/Dockerfile
================================================
FROM debian:stretch
COPY sources.list /etc/apt/sources.list
================================================
FILE: .travis/docker-debian-stretch/sources.list
================================================
deb http://archive.debian.org/debian/ stretch contrib main non-free
deb http://archive.debian.org/debian stretch-backports main
deb http://archive.debian.org/debian-security stretch/updates main
================================================
FILE: .travis/examples.sh
================================================
#!/bin/sh
WHITE='\033[1;37m'
NC='\033[0m' # No Color
set -e
ROOT=$(dirname $(dirname $(realpath $0)))
. $ROOT/.travis/ci-system-setup.sh
for t in `find examples -name ci.sh`
do
df -h
ex=$(dirname $t)
echo ::group:: $ex
echo $WHITE $ex $NC
( cd $ex ; sh ./ci.sh )
if [ -n "$CI" ]
then
cargo clean
fi
echo ::endgroup::
done
================================================
FILE: .travis/llm-expectations-541
================================================
Qwen--Qwen3-1.7B-f16f16.p0s100.arm64.cpu 0.96
Qwen--Qwen3-1.7B-f16f16.p0s100.arm64.metal 0.96
Qwen--Qwen3-1.7B-f16f16.p0s100.x86_64.cpu 0.99
Qwen--Qwen3-1.7B-f16f16.p0s100.x86_64.cuda 0.99
Qwen--Qwen3-1.7B-f16f16.p50s50.arm64.cpu 0.97
Qwen--Qwen3-1.7B-f16f16.p50s50.arm64.metal 0.97
Qwen--Qwen3-1.7B-f16f16.p50s50.x86_64.cpu 0.99
Qwen--Qwen3-1.7B-f16f16.p50s50.x86_64.cuda 0.99
Qwen--Qwen3-1.7B-f16f16.p99s1.arm64.cpu 0.99
Qwen--Qwen3-1.7B-f16f16.p99s1.arm64.metal 0.99
Qwen--Qwen3-1.7B-f16f16.p99s1.x86_64.cpu 0.99
Qwen--Qwen3-1.7B-f16f16.p99s1.x86_64.cuda 0.99
Qwen--Qwen3-1.7B-q40ef16.p0s100.arm64.cpu 0.92
Qwen--Qwen3-1.7B-q40ef16.p0s100.arm64.metal 0.98
Qwen--Qwen3-1.7B-q40ef16.p0s100.x86_64.cpu 0.99
Qwen--Qwen3-1.7B-q40ef16.p0s100.x86_64.cuda 0.92
Qwen--Qwen3-1.7B-q40ef16.p50s50.arm64.cpu 0.96
Qwen--Qwen3-1.7B-q40ef16.p50s50.arm64.metal 0.99
Qwen--Qwen3-1.7B-q40ef16.p50s50.x86_64.cpu 0.99
Qwen--Qwen3-1.7B-q40ef16.p50s50.x86_64.cuda 0.98
Qwen--Qwen3-1.7B-q40ef16.p99s1.arm64.cpu 0.97
Qwen--Qwen3-1.7B-q40ef16.p99s1.arm64.metal 0.99
Qwen--Qwen3-1.7B-q40ef16.p99s1.x86_64.cpu 0.99
Qwen--Qwen3-1.7B-q40ef16.p99s1.x86_64.cuda 0.96
Qwen--Qwen3-8B-f16f16.p0s100.arm64.cpu 0.94
Qwen--Qwen3-8B-f16f16.p0s100.arm64.metal 0.95
Qwen--Qwen3-8B-f16f16.p0s100.x86_64.cpu 0.99
Qwen--Qwen3-8B-f16f16.p0s100.x86_64.cuda 0.99
Qwen--Qwen3-8B-f16f16.p50s50.arm64.cpu 0.94
Qwen--Qwen3-8B-f16f16.p50s50.arm64.metal 0.95
Qwen--Qwen3-8B-f16f16.p50s50.x86_64.cpu 0.99
Qwen--Qwen3-8B-f16f16.p50s50.x86_64.cuda 0.99
Qwen--Qwen3-8B-f16f16.p99s1.arm64.cpu 0.96
Qwen--Qwen3-8B-f16f16.p99s1.arm64.metal 0.99
Qwen--Qwen3-8B-f16f16.p99s1.x86_64.cpu 0.99
Qwen--Qwen3-8B-f16f16.p99s1.x86_64.cuda 0.99
Qwen--Qwen3-8B-q40ef16.p0s100.arm64.cpu 0.86
Qwen--Qwen3-8B-q40ef16.p0s100.arm64.metal 0.97
Qwen--Qwen3-8B-q40ef16.p0s100.x86_64.cpu 0.99
Qwen--Qwen3-8B-q40ef16.p0s100.x86_64.cuda 0.96
Qwen--Qwen3-8B-q40ef16.p50s50.arm64.cpu 0.98
Qwen--Qwen3-8B-q40ef16.p50s50.arm64.metal 0.99
Qwen--Qwen3-8B-q40ef16.p50s50.x86_64.cpu 0.99
Qwen--Qwen3-8B-q40ef16.p50s50.x86_64.cuda 0.99
Qwen--Qwen3-8B-q40ef16.p99s1.arm64.cpu 0.96
Qwen--Qwen3-8B-q40ef16.p99s1.arm64.metal 0.98
Qwen--Qwen3-8B-q40ef16.p99s1.x86_64.cpu 0.99
Qwen--Qwen3-8B-q40ef16.p99s1.x86_64.cuda 0.96
apple--OpenELM-270M-f16f16.p0s100.arm64.cpu 0.98
apple--OpenELM-270M-f16f16.p0s100.arm64.metal 0.99
apple--OpenELM-270M-f16f16.p0s100.x86_64.cpu 0.99
apple--OpenELM-270M-f16f16.p0s100.x86_64.cuda 0.98
apple--OpenELM-270M-f16f16.p50s50.arm64.cpu 0.92
apple--OpenELM-270M-f16f16.p50s50.arm64.metal 0.92
apple--OpenELM-270M-f16f16.p50s50.x86_64.cpu 0.99
apple--OpenELM-270M-f16f16.p50s50.x86_64.cuda 0.99
apple--OpenELM-270M-f16f16.p99s1.arm64.cpu 0.97
apple--OpenELM-270M-f16f16.p99s1.arm64.metal 0.99
apple--OpenELM-270M-f16f16.p99s1.x86_64.cpu 0.99
apple--OpenELM-270M-f16f16.p99s1.x86_64.cuda 0.99
apple--OpenELM-270M-q40ef16.p0s100.arm64.cpu 0.99
apple--OpenELM-270M-q40ef16.p0s100.arm64.metal 0.99
apple--OpenELM-270M-q40ef16.p0s100.x86_64.cpu 0.99
apple--OpenELM-270M-q40ef16.p0s100.x86_64.cuda 0.95
apple--OpenELM-270M-q40ef16.p50s50.arm64.cpu 0.97
apple--OpenELM-270M-q40ef16.p50s50.arm64.metal 0.95
apple--OpenELM-270M-q40ef16.p50s50.x86_64.cpu 0.99
apple--OpenELM-270M-q40ef16.p50s50.x86_64.cuda 0.94
apple--OpenELM-270M-q40ef16.p99s1.arm64.cpu 0.99
apple--OpenELM-270M-q40ef16.p99s1.arm64.metal 0.99
apple--OpenELM-270M-q40ef16.p99s1.x86_64.cpu 0.99
apple--OpenELM-270M-q40ef16.p99s1.x86_64.cuda 0.89
meta-llama--Llama-3.1-8B-Instruct-f16f16.p0s100.arm64.cpu 0.96
meta-llama--Llama-3.1-8B-Instruct-f16f16.p0s100.arm64.metal 0.92
meta-llama--Llama-3.1-8B-Instruct-f16f16.p0s100.x86_64.cpu 0.99
meta-llama--Llama-3.1-8B-Instruct-f16f16.p0s100.x86_64.cuda 0.99
meta-llama--Llama-3.1-8B-Instruct-f16f16.p50s50.arm64.cpu 0.95
meta-llama--Llama-3.1-8B-Instruct-f16f16.p50s50.arm64.metal 0.95
meta-llama--Llama-3.1-8B-Instruct-f16f16.p50s50.x86_64.cpu 0.98
meta-llama--Llama-3.1-8B-Instruct-f16f16.p50s50.x86_64.cuda 0.98
meta-llama--Llama-3.1-8B-Instruct-f16f16.p99s1.arm64.cpu 0.97
meta-llama--Llama-3.1-8B-Instruct-f16f16.p99s1.arm64.metal 0.99
meta-llama--Llama-3.1-8B-Instruct-f16f16.p99s1.x86_64.cpu 0.99
meta-llama--Llama-3.1-8B-Instruct-f16f16.p99s1.x86_64.cuda 0.99
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p0s100.arm64.cpu 0.93
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p0s100.arm64.metal 0.99
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p0s100.x86_64.cpu 0.97
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p0s100.x86_64.cuda 0.97
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p50s50.arm64.cpu 0.93
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p50s50.arm64.metal 0.98
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p50s50.x86_64.cpu 0.99
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p50s50.x86_64.cuda 0.99
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p99s1.arm64.cpu 0.97
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p99s1.arm64.metal 0.99
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p99s1.x86_64.cpu 0.99
meta-llama--Llama-3.1-8B-Instruct-q40ef16.p99s1.x86_64.cuda 0.97
meta-llama--Llama-3.2-1B-Instruct-f16f16.p0s100.arm64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f16f16.p0s100.arm64.metal 0.99
meta-llama--Llama-3.2-1B-Instruct-f16f16.p0s100.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f16f16.p0s100.x86_64.cuda 0.99
meta-llama--Llama-3.2-1B-Instruct-f16f16.p50s50.arm64.cpu 0.96
meta-llama--Llama-3.2-1B-Instruct-f16f16.p50s50.arm64.metal 0.96
meta-llama--Llama-3.2-1B-Instruct-f16f16.p50s50.x86_64.cpu 0.98
meta-llama--Llama-3.2-1B-Instruct-f16f16.p50s50.x86_64.cuda 0.97
meta-llama--Llama-3.2-1B-Instruct-f16f16.p99s1.arm64.cpu 0.97
meta-llama--Llama-3.2-1B-Instruct-f16f16.p99s1.arm64.metal 0.99
meta-llama--Llama-3.2-1B-Instruct-f16f16.p99s1.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f16f16.p99s1.x86_64.cuda 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p0s100.arm64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p0s100.arm64.metal 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p0s100.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p0s100.x86_64.cuda 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p50s50.arm64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p50s50.arm64.metal 0.96
meta-llama--Llama-3.2-1B-Instruct-f32f32.p50s50.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p50s50.x86_64.cuda 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p99s1.arm64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p99s1.arm64.metal 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p99s1.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-f32f32.p99s1.x86_64.cuda 0.99
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p0s100.arm64.cpu 0.97
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p0s100.arm64.metal 0.99
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p0s100.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p0s100.x86_64.cuda 0.98
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p50s50.arm64.cpu 0.86
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p50s50.arm64.metal 0.99
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p50s50.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p50s50.x86_64.cuda 0.94
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p99s1.arm64.cpu 0.98
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p99s1.arm64.metal 0.99
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p99s1.x86_64.cpu 0.99
meta-llama--Llama-3.2-1B-Instruct-q40ef16.p99s1.x86_64.cuda 0.99
meta-llama--Llama-3.2-3B-Instruct-f16f16.p0s100.arm64.cpu 0.98
meta-llama--Llama-3.2-3B-Instruct-f16f16.p0s100.arm64.metal 0.97
meta-llama--Llama-3.2-3B-Instruct-f16f16.p0s100.x86_64.cpu 0.99
meta-llama--Llama-3.2-3B-Instruct-f16f16.p0s100.x86_64.cuda 0.99
meta-llama--Llama-3.2-3B-Instruct-f16f16.p50s50.arm64.cpu 0.96
meta-llama--Llama-3.2-3B-Instruct-f16f16.p50s50.arm64.metal 0.98
meta-llama--Llama-3.2-3B-Instruct-f16f16.p50s50.x86_64.cpu 0.99
meta-llama--Llama-3.2-3B-Instruct-f16f16.p50s50.x86_64.cuda 0.99
meta-llama--Llama-3.2-3B-Instruct-f16f16.p99s1.arm64.cpu 0.96
meta-llama--Llama-3.2-3B-Instruct-f16f16.p99s1.arm64.metal 0.98
meta-llama--Llama-3.2-3B-Instruct-f16f16.p99s1.x86_64.cpu 0.99
meta-llama--Llama-3.2-3B-Instruct-f16f16.p99s1.x86_64.cuda 0.99
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p0s100.arm64.cpu 0.96
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p0s100.arm64.metal 0.99
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p0s100.x86_64.cpu 0.99
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p0s100.x86_64.cuda 0.99
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p50s50.arm64.cpu 0.97
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p50s50.arm64.metal 0.98
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p50s50.x86_64.cpu 0.99
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p50s50.x86_64.cuda 0.97
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p99s1.arm64.cpu 0.93
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p99s1.arm64.metal 0.99
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p99s1.x86_64.cpu 0.99
meta-llama--Llama-3.2-3B-Instruct-q40ef16.p99s1.x86_64.cuda 0.94
================================================
FILE: .travis/make_bundle.sh
================================================
#!/bin/sh
set -ex
TRAVIS_COMMIT=${GITHUB_SHA:-dummy-commit-id}
BRANCH=$(echo $GITHUB_HEAD_REF | tr '/' '_')
BRANCH=${BRANCH:-main}
PLATFORM=${PLATFORM:-dummy-platform}
dates=`date -u +"%Y%m%dT%H%M%S %s"`
date_iso=`echo $dates | cut -f 1 -d ' '`
timestamp=`echo $dates | cut -f 2 -d ' '`
TASK_NAME=tract-$date_iso
mkdir -p $TASK_NAME
echo "export TASK_NAME=$TASK_NAME" > $TASK_NAME/vars
echo "export TRAVIS_COMMIT=$TRAVIS_COMMIT" >> $TASK_NAME/vars
TRAVIS_BRANCH_SANE=`echo $BRANCH | tr '/' '_'`
echo "export TRAVIS_BRANCH_SANE=$TRAVIS_BRANCH_SANE" >> $TASK_NAME/vars
echo "export DATE_ISO=$date_iso" >> $TASK_NAME/vars
echo "export TIMESTAMP=$timestamp" >> $TASK_NAME/vars
echo "export PLATFORM=$PLATFORM" >> $TASK_NAME/vars
if which gstat > /dev/null
then
STAT=gstat
else
STAT=stat
fi
touch sizes
for bin in example-tensorflow-mobilenet-v2 tract
do
if [ -e target/$RUSTC_TRIPLE/release/$bin ]
then
binary_size_cli=$($STAT -c "%s" target/$RUSTC_TRIPLE/release/$bin)
token=$(echo $bin | tr '-' '_')
if [ "$bin" = "tract" ]
then
token=cli
fi
echo binary_size.$token $binary_size_cli >> sizes
fi
done
cp target/$RUSTC_TRIPLE/release/tract $TASK_NAME
cp sizes $TASK_NAME
cp .travis/bundle-entrypoint.sh $TASK_NAME/entrypoint.sh
tar czf $TASK_NAME.tgz $TASK_NAME/
echo $TASK_NAME
================================================
FILE: .travis/minion.sh
================================================
#!/bin/bash
set -ex
. $HOME/.minionrc
exec 200>$LOCKFILE || exit 1
flock -n 200 || { echo "WARN: flock() failed." >&2; exit 0; }
mkdir -p $WORKDIR/taskdone/
for task in `aws s3 ls $S3PATH_TASKS/$PLATFORM/ | awk '{ print $4; }'`
do
cd $HOME
task_name="${task%.tgz}"
if [ -e $WORKDIR/taskdone/$task_name ]
then
continue
fi
echo considering task $task
rm -rf $WORKDIR/current
mkdir -p $WORKDIR/current
cd $WORKDIR/current
aws s3 cp s3://$S3PATH_TASKS/$PLATFORM/$task .
tar zxf $task
. $task_name/vars
cd $task_name
(
./entrypoint.sh 2> stderr.log > stdout.log || true
)
gzip stderr.log
gzip stdout.log
aws s3 cp stderr.log.gz s3://$S3PATH_RESULTS/$MINION_ID/$task_name/stderr.log.gz
aws s3 cp stdout.log.gz s3://$S3PATH_RESULTS/$MINION_ID/$task_name/stdout.log.gz
touch $WORKDIR/taskdone/$task_name
cat metrics | sed "s/^/$GRAPHITE_PREFIX.$PLATFORM.$MINION_ID.$TRAVIS_BRANCH_SANE./;s/$/ $TIMESTAMP/" \
| tr '-' '_' > graphite
if nc --version
then
# GNU
export GRAPHITE_HOST
export GRAPHITE_PORT
cat graphite | while read line
do
echo $line | nc -c -w 1 $GRAPHITE_HOST $GRAPHITE_PORT
done
else
# BSD
nc -q 5 $GRAPHITE_HOST $GRAPHITE_PORT < graphite
fi
done
sleep 1
echo "DONE"
================================================
FILE: .travis/minionrc
================================================
MINION_ID=
LOCKFILE=/tmp/minion-lock
PLATFORM=raspbian
GRAPHITE_HOST=graphite-proxy.snips.net
GRAPHITE_PORT=2003
GRAPHITE_PREFIX=tract
S3PATH_TASKS=tract-ci-builds/tasks
S3PATH_LOGS=tract-ci-builds/logs
S3PATH_RESULTS=tract-ci-builds/logs
WORKDIR=$HOME/tract-minion
CACHEDIR=$WORKDIR/cache
================================================
FILE: .travis/native.sh
================================================
#!/bin/sh
set -ex
if [ -z "$RUSTUP_TOOLCHAIN" ]
then
export RUSTUP_TOOLCHAIN=1.91.0
fi
rustup update
cargo update
cargo check --all-targets --workspace --exclude test-tflite --exclude test-metal --exclude tract-metal
./.travis/onnx-tests.sh
./.travis/regular-tests.sh
./.travis/test-harness.sh
if [ -n "$CI" ]
then
cargo clean
fi
if [ `uname` = "Linux" ]
then
./.travis/tflite.sh
fi
if [ -n "$CI" ]
then
cargo clean
fi
if nvidia-smi > /dev/null 2>&1
then
cargo test -p tract-cuda --lib
cargo test -p test-cuda
fi
./.travis/cli-tests.sh
================================================
FILE: .travis/onnx-tests.sh
================================================
#!/bin/sh
set -ex
ROOT=$(dirname $(realpath $0))/..
. $ROOT/.travis/ci-system-setup.sh
opset=onnx_"${1:-1_13_0}"
cargo -q test -p test-unit-core $CARGO_EXTRA -q
cargo -q test -p test-onnx-core $CARGO_EXTRA -q --no-default-features --features $opset
cargo -q test -p test-nnef-cycle $CARGO_EXTRA -q --no-default-features
================================================
FILE: .travis/regular-tests.sh
================================================
#!/bin/sh
set -e
set -x
cd $(dirname $0)
./test-published-crates.sh
if [ -n "$CI" ]
then
cargo clean
fi
./test-rt.sh
if [ -n "$CI" ]
then
cargo clean
fi
================================================
FILE: .travis/run-bundle.sh
================================================
#!/bin/sh
set -ex
BUNDLE_NAME=$1
tar zxf $BUNDLE_NAME.tgz
(
cd $BUNDLE_NAME
. ./vars
./entrypoint.sh
)
# rm -rf "$BUNDLE_NAME" "$BUNDLE_NAME.tgz"
================================================
FILE: .travis/run_all.sh
================================================
#!/bin/sh
set -ex
`dirname $0`/native.sh
cd `dirname $0`/../examples
for i in *
do
(cd $i; cargo test --release)
done
================================================
FILE: .travis/setup-sccache.sh
================================================
#!/bin/sh
set -ex
export SCCACHE_DIR=$HOME/.cache/sccache
export SCCACHE_CACHE_SIZE=2G
if [ -n "$GITHUB_ENV" ]
then
echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV
echo "SCCACHE_CACHE_SIZE=2G" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "$HOME/.local/bin" >> $GITHUB_PATH
fi
LINK=https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION=v0.10.0
echo $HOME
if [ `uname` = "Linux" ]
then
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
else
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-apple-darwin
fi
mkdir -p $SCCACHE_DIR
mkdir -p $HOME/.local/bin
for i in 1 2 3 4 5
do
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz && break
sleep 15
done
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
================================================
FILE: .travis/test-harness.sh
================================================
#!/bin/sh
WHITE='\033[1;37m'
NC='\033[0m' # No Color
if [ -e /proc/cpuinfo ]
then
grep "^flags" /proc/cpuinfo | head -1 | \
grep --color=always '\(s\?sse[0-9_]*\|fma\|f16c\|avx[^ ]*\)'
fi
set -x
ROOT=$(dirname $0)/..
. $ROOT/.travis/ci-system-setup.sh
set -e
if [ `arch` = "x86_64" -a "$RUST_VERSION" = "stable" ]
then
ALL_FEATURES=--all-features
fi
set +x
cargo -q test $CARGO_EXTRA -q -p tract
cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p core-proptest-pulse $ALL_FEATURES
cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p nnef-inceptionv3 $ALL_FEATURES
cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-inceptionv3 $ALL_FEATURES
cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tf-mobilenet-v2 $ALL_FEATURES
cargo -q test $CARGO_EXTRA -q --profile opt-no-lto -p tfl-mobilenet-v2-q $ALL_FEATURES
================================================
FILE: .travis/test-llm.sh
================================================
#!/bin/bash
set -e
set -o pipefail
export LC_ALL=C
ROOT=$(dirname $(dirname $(realpath $0)))
. $ROOT/.travis/ci-system-setup.sh
model=$1
q=$2
device=$3
if [ -z "$device" ]
then
device=cpu
fi
generation=541
if [ "$model" = "all" ]
then
for m in \
openelm-270M \
llama-3.2-1B-instruct \
llama-3.2-3B-instruct \
llama-3.1-8B-instruct \
qwen3-1.7B \
qwen3-8B
do
$0 $m $2 $device
done
exit 0
fi
model=$(echo $model | tr 'A-Z' 'a-z' | tr -d "_.-")
for m in \
apple--OpenELM-270M \
meta-llama--Llama-3.2-1B-Instruct \
meta-llama--Llama-3.2-3B-Instruct \
meta-llama--Llama-3.1-8B-Instruct \
Qwen--Qwen3-1.7B \
Qwen--Qwen3-8B
do
norm=$(echo $m | tr "A-Z" "a-z" | tr -d "_.-")
if [[ "$norm" == *"$model"* ]];
then
model_id=$m
fi
done
if [ -z "$model_id" ]
then
echo "No model matched"
fi
if [ "$q" = "all" ]
then
for q in q40ef16 f16f16 f32f32
do
$0 $1 $q $device
done
exit 0
fi
id=$model_id-$q
if which gstat > /dev/null
then
STAT=gstat
else
STAT=stat
fi
nnef=llm/$generation/$id/$id.nnef.tgz
$CACHE_FILE $nnef
if [ -e $MODELS/$nnef ]
then
size=$($STAT -c %s $MODELS/$nnef)
else
size=$(curl -s -I $MODELS/$nnef | grep Content-Length | cut -d " " -f 2 | tr -cd 0123456789)
fi
if which nvidia-smi > /dev/null
then
vram=$(nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits | awk '{print $1*1024*1024}')
if [ $vram -lt $size ]
then
echo "::warning::Skipping this test, not enough VRAM."
exit 0
fi
fi
$TRACT_RUN -v --nnef-tract-transformers $MODELS/$nnef -O --readings --assert-maximal-mm-quality-cost 0 $TRACT_EXTRA_ARGS dump -q
alloc_max=$(cat readings.out | tail -n +2 | awk '{print $10-$11}' | sort -n | tail -1)
ratio=$((alloc_max * 100 / size))
echo " ###########################################"
echo " Alloc max to model size ratio: ${ratio}%."
echo " ###########################################"
limit=125
if [ $ratio -gt $limit ]
then
echo "RSZ max is ${ratio}% the size of the unzipped model!"
exit 1
fi
for t in p0s100 p50s50 p99s1
do
npz=llm/$generation/$id/$id.$t.io.npz
$CACHE_FILE $npz
key=$id.$t.$(arch).$device
expectations="$ROOT/.travis/llm-expectations-541"
echo
echo " Key: $key"
echo
case $device in
cuda)
DEVICE="--cuda"
GPU_ASSERT="--assert-op-only Cuda*,Gpu*,DeviceSync*,Const,Source,Range,Gather"
;;
metal)
DEVICE="--metal"
GPU_ASSERT="--assert-op-only Metal*,Gpu*,DeviceSync*,Const,Source,Range,Gather"
;;
*)
GPU_ASSERT=""
;;
esac
if [ -n "$RESET" ]
then
$TRACT_RUN -v $MODELS/$nnef $TRACT_EXTRA_ARGS \
--llm --transform unfold-kv-cache -O $DEVICE run --prompt-chunk-size 60 --allow-missing-outputs \
--input-from-npz $MODELS/$npz \
--assert-output-bundle $MODELS/$npz \
--assert-llm-rbo 0.0 \
$approx --allow-float-casts $GPU_ASSERT 2>&1 | tee output.txt
found=$(cat output.txt | perl -MPOSIX=floor -ne 'printf("%.2f\n", floor($1 * 100) / 100) if /LLM RBO:\s+([\d.]+)/')
( ( grep -v $key $expectations || true) ; echo $key $found) | sort > $expectations.tmp
mv $expectations.tmp $expectations
elif [ -n "$RELAX" ]
then
prior=$(grep $key $expectations | cut -f 2 -d ' ')
$TRACT_RUN -v $MODELS/$nnef $TRACT_EXTRA_ARGS \
--llm --transform unfold-kv-cache -O $DEVICE run --prompt-chunk-size 60 --allow-missing-outputs \
--input-from-npz $MODELS/$npz \
--assert-output-bundle $MODELS/$npz \
--assert-llm-rbo 0.0 \
$approx --allow-float-casts $GPU_ASSERT 2>&1 | tee output.txt
found=$(cat output.txt | perl -MPOSIX=floor -ne 'printf("%.2f\n", floor($1 * 100) / 100) if /LLM RBO:\s+([\d.]+)/')
if [ -n "$prior" ] && perl -e 'exit($ARGV[0] <= $ARGV[1] ? 1 : 0)' "$found" "$prior"
then
found=$prior
fi
( ( grep -v $key $expectations || true) ; echo $key $found) | sort > $expectations.tmp
mv $expectations.tmp $expectations
else # test !
expectation=$(grep $key $expectations | cut -f 2 -d ' ')
$TRACT_RUN -v $MODELS/$nnef $TRACT_EXTRA_ARGS \
--llm --transform unfold-kv-cache -O $DEVICE run --prompt-chunk-size 60 --allow-missing-outputs \
--input-from-npz $MODELS/$npz \
--assert-output-bundle $MODELS/$npz \
--assert-llm-rbo $expectation \
$approx --allow-float-casts $GPU_ASSERT
fi
done
================================================
FILE: .travis/test-published-crates.sh
================================================
#!/bin/sh
WHITE='\033[1;37m'
NC='\033[0m' # No Color
if [ -e /proc/cpuinfo ]
then
grep "^flags" /proc/cpuinfo | head -1 | \
grep --color=always '\(s\?sse[0-9_]*\|fma\|f16c\|avx[^ ]*\)'
fi
set -x
ROOT=$(dirname $0)/..
. $ROOT/.travis/ci-system-setup.sh
set -e
if [ `arch` = "x86_64" -a "$RUST_VERSION" = "stable" ]
then
ALL_FEATURES=--all-features
fi
set +x
cargo update
echo
echo "$WHITE ### tract ### $NC"
echo
cargo -q test $CARGO_EXTRA -q -p tract
for c in data linalg core nnef hir onnx pulse onnx-opl pulse-opl
do
echo
echo "$WHITE ### $c ### $NC"
echo
cargo -q test $CARGO_EXTRA -q -p tract-$c
done
if [ `uname` = "Darwin" -a -z "$CI" ]
then
echo
echo "$WHITE ### metal ### $NC"
echo
cargo -q test $CARGO_EXTRA -q -p tract-metal
fi
if command -v nvcc >/dev/null 2>&1 && [ -z "$CI" ]
then
echo
echo "$WHITE ### cuda ### $NC"
echo
cargo -q test -q -p tract-cuda
fi
$ROOT/api/proxy/ci.sh
# doc test are not finding libtensorflow.so
if ! cargo -q test $CARGO_EXTRA -q -p tract-tensorflow --lib $ALL_FEATURES
then
# this crate triggers an incremental bug on nightly.
cargo clean -p tract-tensorflow
cargo -q test $CARGO_EXTRA -q -p tract-tensorflow --lib $ALL_FEATURES
fi
================================================
FILE: .travis/test-rt.sh
================================================
#!/bin/sh
WHITE='\033[1;37m'
NC='\033[0m' # No Color
if [ -e /proc/cpuinfo ]
then
grep "^flags" /proc/cpuinfo | head -1 | \
grep --color=always '\(s\?sse[0-9_]*\|fma\|f16c\|avx[^ ]*\)'
fi
set -x
ROOT=$(dirname $0)/..
. $ROOT/.travis/ci-system-setup.sh
set -e
if [ `arch` = "x86_64" -a "$RUST_VERSION" = "stable" ]
then
ALL_FEATURES=--all-features
fi
set +x
cd $ROOT
for c in test-rt/test*; do
case "$c" in
test-rt/test-tflite)
echo "$WHITE ### $c ### IGNORED $NC"
continue
;;
test-rt/test-metal)
if [ "$(uname)" != "Darwin" ] || [ -n "$CI" ]; then
echo "$WHITE ### $c ### IGNORED $NC"
continue
fi
;;
test-rt/test-cuda)
if ! command -v nvcc >/dev/null; then
echo "$WHITE ### $c ### IGNORED $NC"
continue
fi
;;
esac
echo
echo "$WHITE ### $c ### $NC"
echo
(cd "$c" && cargo test -q $CARGO_EXTRA)
if [ -n "$CI" ]; then
df -h
cargo clean
fi
done
================================================
FILE: .travis/tf.sh
================================================
#!/bin/sh
set -ex
if [ -z "$CACHEDIR" ]
then
CACHEDIR=`dirname $0`/../.cached
fi
(cd tensorflow; cargo test --release --features conform)
================================================
FILE: .travis/tflite/Dockerfile.tensorflow-aarch64
================================================
# vim: set syntax=Dockerfile:
FROM tensorflow/tensorflow:devel
RUN apt-get update ; apt-get upgrade -y
RUN apt-get install -y crossbuild-essential-arm64
COPY linux_makefile.inc /tensorflow_src/tensorflow/lite/tools/make/targets/linux_makefile.inc
COPY disable_nnapi.patch /tensorflow_src
WORKDIR /tensorflow_src
RUN patch -p1 < disable_nnapi.patch
================================================
FILE: .travis/tflite/Dockerfile.tensorflow-official-rpi
================================================
# vim: set syntax=Dockerfile:
FROM tensorflow/tensorflow:nightly-devel
RUN apt-get update ; apt-get upgrade -y
RUN apt-get -y install git crossbuild-essential-armhf
WORKDIR /tensorflow
RUN ./tensorflow/lite/tools/make/download_dependencies.sh
================================================
FILE: .travis/tflite/Dockerfile.tensorflow-rpitools
================================================
# vim: set syntax=Dockerfile:
FROM tensorflow/tensorflow:nightly-devel
RUN apt-get update ; apt-get upgrade -y
RUN apt-get -yy install git
WORKDIR /tensorflow
RUN ./tensorflow/lite/tools/make/download_dependencies.sh
RUN git clone https://github.com/raspberrypi/tools /raspitools
ENV PATH=/raspitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin:$PATH
================================================
FILE: .travis/tflite/build_tflite_aarch64.sh
================================================
#!/bin/sh
set -ex
mkdir -p result
docker build -f Dockerfile.tensorflow-aarch64 --tag tensorflow-aarch64 .
docker run --rm -it \
-v `pwd`/result:/result \
tensorflow-aarch64 \
sh -c "
cd /tensorflow_src ;
export EXTRA_CXXFLAGS=-flax-vector-conversions
export DISABLE_NNAPI=true
./tensorflow/lite/tools/make/download_dependencies.sh
make -j 3 -f tensorflow/lite/tools/make/Makefile TARGET=linux TARGET_ARCH=aarch64 ;
cp /tensorflow_src/tensorflow/lite/tools/make/gen/linux_aarch64/bin/benchmark_model /result/tflite_benchmark_model_aarch64
"
================================================
FILE: .travis/tflite/build_tflite_raspbian.sh
================================================
#!/bin/sh
set -ex
mkdir -p result
# build pseudo-rpi official tensorflow, https://www.tensorflow.org/lite/rpi, only works on pi3
docker build -f Dockerfile.tensorflow-official-rpi --tag tensorflow-official-rpi .
docker run --rm \
-e CC_PREFIX=arm-linux-gnueabihf- \
-v `pwd`/result:/result \
tensorflow-official-rpi \
sh -c "
make -j 3 -f tensorflow/lite/tools/make/Makefile TARGET=rpi TARGET_ARCH=armv7l;
cp /tensorflow/tensorflow/lite/tools/make/gen/rpi_armv7l/bin/benchmark_model /result/tflite_benchmark_model_official_rpi
"
# build with rpi tools (works on rpi0, 1 and 2)
docker build -f Dockerfile.tensorflow-rpitools --tag tensorflow-rpitools .
docker run --rm \
-e CC_PREFIX=arm-linux-gnueabihf- \
-v `pwd`/result:/result \
tensorflow-rpitools \
sh -c "
make -j 3 -f tensorflow/lite/tools/make/Makefile TARGET=rpi TARGET_ARCH=armv6;
cp /tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/benchmark_model /result/tflite_benchmark_model_rpitools
"
================================================
FILE: .travis/tflite/convert_all.sh
================================================
run_in_tf_docker() {
docker run --rm -v $HOME/.cache:/models -it tensorflow/tensorflow:nightly-devel sh -c "$@"
}
# # inception v3
# run_in_tf_docker "cd /models ; tflite_convert \
# --graph_def_file inception_v3_2016_08_28_frozen.pb \
# --input_arrays input \
# --input_shapes 1,299,299,3 \
# --output_arrays InceptionV3/Predictions/Reshape_1 \
# --output_format tflite \
# --output_file inception_v3_2016_08_28_frozen.tflite"
#
# # arm ml kws
# run_in_tf_docker "cd /models ; tflite_convert \
# --graph_def_file ARM-ML-KWS-CNN-M.pb \
# --input_arrays Mfcc \
# --input_shapes 1,49,10 \
# --output_arrays labels_softmax \
# --output_format tflite \
# --output_file ARM-ML-KWS-CNN-M.tflite"
# hey_snips v1
run_in_tf_docker "cd /models ; tflite_convert \
--graph_def_file hey_snips_v1.pb \
--input_arrays inputs \
--input_shapes 80,40 \
--output_arrays logits \
--output_format tflite \
--output_file hey_snips_v1.tflite"
# hey_snips v3.1
# (tflite does not support 1D dil)
# run_in_tf_docker "cd /models ; tflite_convert \
# --graph_def_file hey_snips_v3.1.pb \
# --input_arrays inputs \
# --input_shapes 40,40 \
# --output_arrays logits \
# --output_format tflite \
# --output_file hey_snips_v3.1.tflite"
#
# # hey_snips v4 model17, 2seconds
# (tflite does not support AddN)
# run_in_tf_docker "cd /models ; tflite_convert \
# --graph_def_file hey_snips_v4_model17.pb \
# --input_arrays input_node \
# --input_shapes 200,20 \
# --output_arrays output_node \
# --output_format tflite \
# --output_file hey_snips_v4_model17.tflite"
================================================
FILE: .travis/tflite/linux_makefile.inc
================================================
# Settings for Linux.
ifeq ($(TARGET), linux)
CXXFLAGS += \
-fPIC \
-DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \
-pthread
# TODO(petewarden): In the future we may want to add architecture-specific
# flags like -msse4.2
LIBS := -lstdc++ -lpthread -lm -ldl
TARGET_ARCH=aarch64
TARGET_TOOLCHAIN_PREFIX := aarch64-linux-gnu-
endif
================================================
FILE: .travis/tflite/run_all.sh
================================================
#!/bin/sh
./benchmark_model --graph=inception_v3_2016_08_28_frozen.tflite
================================================
FILE: .travis/tflite.sh
================================================
#!/bin/sh
set -ex
ROOT=$(dirname $(dirname $(realpath $0)))
. $ROOT/.travis/ci-system-setup.sh
if [ `uname` = "Darwin" ]
then
brew install coreutils
fi
if [ -n "$GITHUB_ACTIONS" ]
then
pip install numpy
fi
cargo check -p tract-tflite
cargo -q test -p test-tflite $CARGO_EXTRA -q
================================================
FILE: .travis/travis.sh
================================================
#!/bin/sh
set -ex
if [ -z "$PLATFORM" ]
then
.travis/native.sh
else
.travis/cross.sh
fi
================================================
FILE: .travis.yml
================================================
language: rust
dist: trusty
cache:
# - cargo
#- directories:
#- $HOME/cached
addons:
apt:
packages:
- awscli
- jshon
- moreutils
env:
global:
- RUST_BACKTRACE=1
- AWS_DEFAULT_REGION=us-east-1
# - CACHEDIR=$HOME/cached
- secure: DdQqS4fFDevY/JknS0M6CwW+ooj6ZhKmBk4lFliG3WQgjYietbPMCkiHPEC8Df8U07l54+8G4j+sZJJ4VYQY8WQcuKGWt9/ALjoYHYZ1Dlw0KW0rRJ1BZWLUh8MwpJ5pxHSWfl1a8QqTy/0mI3eJ8iVIDxiZR6b1fGwPYDkNXyqnfOvz31X1aMyoGslNkP7LitObCdBJyzobPlvWafGCQLf7oLbK4a5Ysyc9T607n1B0okco3Te2ztahEOwNoxmHlEFRojM6ZmAmo8LzwkCdFQNjHw+mQ3vScC8gpngi61G9U35luAfweMt30m1UmecVGADeEmwSnJLeAHo5HYKT5n6Q1begxlMGMxezinstTHUX6G8EhEumO/ii3PAscFJ6C+VfciGA7JDS2ICghygKSIqQvVeugNR0glW97lhszLnoXCNY45siknAZVTVqwhgn1ctTQiPWqGVuQp+m9NYIoQAYUpOFNo1mEtEjurHOk96Q0XjRJMfUSLOB5KfPakk/ghEY1ZYDDB9wi134f3Z5hLw1FGj/Uiw9LcnEIcORV2o8fbFrb2IgGsKQbRtdPEJ92q5bdeA00TbSrzoDDRFGbwBg+8ibFMF8O2J3Q54sUu6LmkP7qjtMIT2vB09M7LWQYtW3Vd6ovHwI6v+tNJK2D4cJA0KOSwzpOgIBhEubrZI=
- secure: su5wLbN7lr59HSKGM8M9pW9VSFMtdTBbQ1oBZFTvw+RNoNew3BBMh8XymbjEv6R+yyGmDAa8Dw6E7HPiBtI5O4q89rHxl7MO5keZINjpXDzTydZ5MQ2juZPIRQpLfpl6AN1meG8I3SoOrTMDgGqfPh2rqEjIS6cBZbo8Re/0KSBuJB781qdT6x80Qfpy87sDu9GTRM8ueXsV+jRw0Yek709m29MSB8pkFAP9OitKHxzF5OFnxVPV2becj53racOe7q9ZE5QWmWnzPZUxflVyrtzDsN0J/C4g0SoEbxLFg1OLbffO1GVJ/Iv6ZeaggzYRvCYwSSANyfqorqSUDT5NPwQlUXjgBPHlOXbCfY2s5hFzQQ3z4R86fyzfdfBQ56uXTXkB4CWpn/JieUoviuDO0/YNaI0KU6hOrOn68BZrBSqwHcxwhtcP3cw/EXfR1aiok7OoDPAWnR4f3Lu/+fmkW+VUEg5Ufh/GgjZt7XwsNBfo+pmvO3mO/5okxa2/HbOwcoTpELAzPMKyh1xn5gjrk5bWcZofeGtFMoXN4+G8+1qlQ/sLp3144QHyRf00n4qlhA6xZwplpBWN12haXyKRx67lPTzE5QuT1BRoyCdRvbjQiOdo61xGvoOK9J8PL9C06xtnKQ+6iDnjFaWielASoENvcNL+DCKqiecpUb5hoR4=
- secure: HZHubUhHLYh+v5yuyMy5TmfleHqAdcmVZd6hZf7c2sXQLsrcjoLGPxu4jzS9OJt27Sfp6xXVFeeA7SFDMobxe8AFm3+SRCbzvT6mu8/LlsuTsQO3jYQtt8j5OIhtLQ7yfDyOscXwy2I3SgluhVQ0HCIi6ShQ8YRD1vE119Qku2x/sWlKcZQckcl5T/yyig08sXfOM+IfFQPIW1gvMWM3dv6RigiCiy4qjfeQy8v8xbvbRayXeT4Vpfv9CqN79kAQ03r7MSmBBn6i88mGoQEzVDMEZPZq8rMNqn8qyIn8LxjXaCpUz0fTCYJrHSmzKyCE7+k7IEidlkyT6hJpvpXCfNYBSk2fB7SDxlm98ELVgqPBq6vjYoPaqsqs7Cz+pTTQYOCnCKvRDYhccqhAsgjNVKDRIJc0H7cT5sv4TuJxsMp/vYVh7RxoFem2r37ns4pu8XPP9RVsmoAVYzlHu8Fnd8TWY30MXACf3t43ceaPfor0IARrZcjQR1lt7eMJGQDkduJRxzq0cBB1djP8HfZGab/I0cVFEXGeJWDQfaHZ8Pq/M3+bBPLD9XLqKmpoNbW+gqQQl49/w01/EJrp9QhK/Og6ujfkeA1OCziPCUDLAHYvmwaYZYzV9z5VSPfUYwiiJzva92/ywWfhCmz3SpXPbq8cTPoDWzeBUeqcw8iIWVU=
- secure: vH8bS7RVgaHLGZUeqtViCQYDJfhubMiCMETLPD959pv9sODmSfjOhYtFgZtbn0wZ2fhCQFgKhYKUJdti5Vo9OUlyBiUsfLPilAAaeZu0Y2SQIKpbuNU9kJibuzyj6KZoRhjvsifhO5/mB03W7CpzjSGvJntK62BM0b6CrDtUlHlOgjwd3U1c5brZS9VWfnkh8pohgneB/XYtefTJXHuGjJgf75uw2TO/ZKQmmaKJWPoMVN76cgarRmXS/SoGMLr0+7ArnvIMNW9QRMABrSzUgP0RBvNfndwjiIQDZpIefIz/UVTa5e/pS79CLoQKM9FSWZANf3ZJgz0SzYgMprSe9f3RZGu5i0BLQA0SzdxCjCra5/3/pz+p86/iWGHnBfV6pvH9c2W1OUCCTiohNk7bgUfXxVrxk2RHxhc375MFiCxu6KtPRW8kJoRTSZP+k2itaBPUSevV0cdWrVlRjnTwoCskxMIFQH+vStxQjUXV0/g9SZzwdIR/j1aKIjb6VdQS2WOh0+BKgHy0jy2w4GJHtuObIg0aTcQAtt44aK0T/VeHJ0f1FxfjzPxrcqcgSxvi2E4HgedSCvtOHPWs5YYYGt76yH0G5ZOMOF8xP2CRStlcNB0TtLdpcUvQT2ejK7t4sCOj8Kz81s2cbLCZnJdkFaaBsffV7JtbjexXRwohGxI=
matrix:
include:
- rust: stable
- rust: stable
env: PLATFORM=raspbian
- rust: 1.35.0
- rust: stable
script: .travis/tf.sh
- rust: stable
script: .travis/debug-tests.sh
- rust: stable
os: osx
osx_image: xcode9.3
env: PARTIAL_CI=true
- rust: stable
env: PLATFORM=aarch64-unknown-linux-gnu
- rust: stable
env:
- PLATFORM=armv6vfp-unknown-linux-gnueabihf
- TRACT_CPU_EXPECT_ARM32_NEON=false
- rust: stable
env:
- PLATFORM=armv7-unknown-linux-gnueabihf
- TRACT_CPU_ARM32_NEON=true
- TRACT_CPU_EXPECT_ARM32_NEON=true
- rust: stable
env: PLATFORM=aarch64-linux-android
- rust: stable
env: PLATFORM=armv7-linux-androideabi
- rust: stable
env: PLATFORM=i686-linux-android
- rust: stable
env: PLATFORM=x86_64-linux-android
- rust: stable
os: osx
osx_image: xcode9.3
env: PLATFORM=aarch64-apple-ios
- rust: beta
- rust: nightly
- rust: stable
os: windows
script: cargo test -p tract-linalg
allow_failures:
- rust: nightly
- os: windows
script: ".travis/travis.sh"
================================================
FILE: .vim/coc-settings.json
================================================
{
"rust-analyzer.imports.granularity.group": "module"
}
================================================
FILE: CHANGELOG.md
================================================
# Unreleased
* [Breaking][MSRV] MSRV bumped to 1.91.0 (for `const TypeId::of`).
# 0.23.0-dev.3 — 2026-03-20
### Breaking changes
- **`Value` renamed to `Tensor`** across the entire public API surface (Rust, C, Python). The deprecated `Value` alias has been removed.
- **Crate renamed: `tract-rs` → `tract`** — update your `Cargo.toml` dependency accordingly. The CLI binary is now `tract-cli` (previously `tract`).
- **`into_tract()` renamed to `into_model()`** in all API layers.
- **`DatumType` variant names shortened** — the `TRACT_DATUM_TYPE_` prefix is dropped (C API).
- **Deprecated state methods removed**: `init_states()`, `state_initializers`, and the `n_states` parameter are gone from `State` trait and `RunTensors`.
- **Python**: `concretize_symbols` and `pulse` methods replaced by typed transform classes; `TransformSpec` is now an abstract base class.
### Improvements
- **`UnfoldKeyValueCacheTransform`** — explicit KV-cache I/O mode now available as a first-class transform (CLI: `--transform unfold-kv-cache`).
- **Structured `NodeFilter`** for `FloatPrecisionTranslator` — replaces raw filter strings.
- Python docs migrated from mkdocs to **Sphinx** (hosted on GitHub Pages with version switcher).
- New GPU inference section (CUDA example, `Runtime` usage).
# 0.23.0-dev.2 - 2026-02-18
* This is a pre-release release. It will be a pretty big one, here are some hilights.
* New public api: tract-rs should be the main point of entry for any new project. A caveat: it does support most of tract simple uses as is, but some specialized sections like state management and model transforms are not satisfactory yet, so the real 0.23.0 will presumably break these again. The plan is that this facade will be tract public API, and that it will be the only surface under semver rules. Up to there is was essentially everything `pub`, which boils down to mostly "everything".
* GPU: The new API puts forward the Runtime trait. It allows running models on GPU (runtimes "cuda" and "metal" offser some support, while "default" is the CPU runtime). See https://github.com/sonos/tract/blob/main/examples/nemo-parakeet-asr/src/main.rs#L21 for an example. Instead of calling into_runnable(), use Runtime::prepare().
* Additionally, the internal API compatibility is broken in many places (e.g. RunnableModel always takes the model as an Arc<TypedModel> while it was accepting AsRef before). As you're going to need to fix code to upgrade, it is recommended to try and use the new "tract-rs" facade (please tell us if the current API coverage is not enough, or awkward to use).
* [Breaking][MSRV] MSRV bumped to 1.89.0
* [linalg] Avoid panic in Apple sysctl-based feature probing (AMX detection).
# 0.22.1 - 2026-02-23
* [backport] Small bug fixes release (Slice decluttering bug)
# 0.22.0 - 2025-08-25
* [Breaking][MSRV] MSRV bumped to 1.85.0
* port to edition 2024
* bump virtuaally each and every dependency
* (wip, experimental) cuda support for llm
# 0.21.14 - 2026-02-23
* [backport] Small bug fixes release (Slice decluttering bug)
# 0.21.12 - 2025-04-10
* multithread matmul is feature gated now ("multithread-mm" on linal)
* full hand made arm64 f32-accumulator matmul kit
* more auditing improvment around einsum and its matmul translations
* bugfix in matmul translation and gather
* more test-rt-level coverage of low-level matmuls (metal and cpu)
* memory arena improvements (metal)
* q40 for convolution weights
# 0.21.11 - 2025-03-19
* [cli] augment audit capabilities for mm implementation choices
* revisit matmul kernel selection
* improve gather with compressed inputs
* revisit slice bubbling up to unlock optimisations
* fix a bug around flipping substractions
* support for left q40 input in arm64 f32 accumulating kernels (unlocks q40f32 compression on arm64)
# 0.21.10 - 2025-02-21
* WIP llm testability (--approx-custom)
* [metal] ggml-ported kernels
* WIP einsum-to-matmul testability
* optimisation around reduce<sum> impacting some modern/exotic normalisation layers
* WIP towards better handling of shared weights (e.g. embeddings duplication)
# 0.21.9 - 2025-01-08
* [metal] experimental profile
* [cpu] new versatile (mmm/mmmv) kernels combinations for various architectures
* [metal] scaled-masked-softmax detector and impl
# 0.21.8 - 2024-12-05
* [linalg, compression] introduce mmm kits
* [linalg] (wip) rework f16 on non-f16 machines
* [linalg] element-wise binary operators optimisation
* [core, compression] gather with compressed weights
* [metal] new kernels
* [metal] new memory management
* [nnef] opt-in deterministic tar encoding
# 0.21.7 - 2024-09-23
* [metal] (experimental) introduce partial support for Apple Metal
* [core] Potential internal API breaking changes (operator names, comparison ops refactored)
* [data] (experimental) Smarter TDim simplification, handling of Min and Max. TDim assertions for simplifications.
* [data] (experimental) WIP around multiple scenarios (modes) for LLM inference
* Extra examples
* [linalg] (experimental) kernels targetting LLM block-quantized tasks (inc. intel 32x1 q40f32)
# 0.21.6 - 2024-07-24
* [data] Rework tdim and symbols, introduce inequalities assertions, min and max operators
* [data] Generalize Blob usage in Tensor
* [linalg] Rework reduce implementation, introduce more generic binary ops support (wip)
* [linalg] Introduce multithreaded matrix multiplication runner
* [linalg] Introduce Q4_0 block quantization for weights (wip)
* [linalg] Introduce AMX f16 kernels, Neon Q40F16 kernel (experimental)
* [linalg] wasm f32 4x4 kernel
* [core] Introduce Opaque and OpaqueFact to escape Tensor and TValue formalism
* [core] generalize/improve float precision translator, with translation filter
* [core] Introduce garbage collecting in patch application, new compact algo, and rework constant propagation to spare memory
* [core] Rework packed format and packing metadata
* [linalg/core] Introduce multiple packing format for matmul kernels
* [core] Work In Progress refactoring binary, towards more optimized execution strategies
* [nnef] inequalities assertions extension, q4_0 extension
* [tflite] plug in tanh and sigmoid
# 0.21.5 - 2024-05-11
* [TFLite] fixes for fully connected and max pool layers
* Allow opting out of new memory friendly execution order optimisation
# 0.21.4 - 2024-04-23
* More memory/cache friendly execution order
* Several fixes around symbolic dimensions computation (some should help with attention models)
# 0.21.3 - 2024-04-03
* [AMX] Put AMX for iOS behind a feature gate ("tract-linalg/apple-amx-ios").
# 0.21.2 - 2024-03-29 (yanked)
* [ONNX] Support for external storage of tensors with offset and length
* [ONNX] Lots of fixes around binary quantized operators (add, mul, etc)
* [PY] Fix python source distribution
* [AMX] Activate AMX on iOS
* [API] Introduce transforms in external api
* [BLAS] Introduce a simple BLAS transform for Matrix multiplication
* [F16] Introduce a Reduce<MeanOfSquares> that solves many L2 normalization errors in f16
This version has been yanked to revert systematic activation of AMX on iOS. AMX is a private API and Apple may reject an App that performs AMX instructions.
# 0.21.1 - 2024-02-08
* [ONNX] Support for external storage of tensors with offset and length
# 0.21.0 - 2024-01-16
* MSRV is now 1.75.0
* [internal] ConvUnary and MatmulUnary are replaced by binary, potentially dynamic equivalent
# 0.20.22 - 2023-11-28
* [ONNX] LayerNormalization support
# 0.20.21 - 2023-10-31
* [ONNX] ignoring output shapes is now the default
*
# 0.20.18 - 2023-08-30
* [intel] fix in AVX512F matrix vector product
* [tflite] alpha, embryonic support. some convolutional models working.
* [kaldi] remove abandonned kaldi experimental support
* [refactoring] Runtime abstraction and runtime-targetting tests
* [refactoring] Refactoring Python and C API around a possible tract-api. Introducing dylib support.
* [pytorch compat] fixes around node names starting by / (bug triggered by recent pytorch versions)
0.20.7 to 0.20.17 are misfires
# 0.20.6 - 2023-06-09
* Bug fixes, fix display of If operator
# 0.20.5 - 2023-05-26
* Various bugfix around Einsum
* Einsum now has functions to translate to MatMul and other axes manipulations
# 0.20.0, 0.20.1, 0,20.2, 0.20.3 - 2023-04-25
* [optim] 32x32 f32 AMX kernel (for Apple Silicon M family)
* [optim] bunch of AMX512F kernels (square, skinny, vector)
* [ONNX] introduce Trilu, TopK
* [NNEF/OPL] submodel loader
* [ONNX] support alternative layout for LSTM (layout=1, batch becomes first axis)
* [ONNX] If operators with dynamic condition (very basic optimisations, no nnef support yet).
# 0.19.9 & 0.19.10 - 2023-04-17
* HardSwiwh ONNX, tract_core_hard_swish in NNEF/OPL
* introducing tract_core_submodel in NNEF/OPL
* JSON resource loader in NNEF/OPL
* Profiling API tweaks
* `--folded` view for model command line dump (hide Scan loops)
# 0.19.8 - 2023-03-27
* Various bug fixes
# 0.19.7 & 0.19.6 - 2023-02-24
* more bug fixes
* wip on python doc auto-deploy
# 0.19.5 - 2023-02-22
* 0.19.3 and 0.19.4 are release misfires
* lots of bugfixes following 0.19 big changes
* introducing the JSON NNEF resource
# 0.19.2 - 2023-01-30
* [NNEF/OPL] introduce json resource loader
* extend Complex number support (under a feature flag)
# 0.19.1 - 2023-01-23
* [nnef] new identifier syntax is now opt-in for serialization (both accepted at loading)
* alpha-level C interface. how and how to deploy it (where to put the .h, whether or not to build and ship dylibs)
* alpha-level python interface. deployed on pypi as "tract". At this stage, API is undocumented and may still change significantly.
# 0.19.0 - 2023-01-11
* [BREAKING] TValue are now used in run() instead of the previous mix of Tensor and Arc<Tensor>
* internal API breaking changes: no more op_families, libcli split away. State is no longer Send (but can be "frozen" to a Send counterpart).
* Symbols can now be String instead of char. They are not shared globally anymore, but scoped in the Model instead.
* [pulse] S symbol is no longer magic. The time dimension symbol must be provided at pulsification time.
* [pulse] In most cases, we can now pulsify without an explicit pulse len (pulse len can be expression).
* [cli] deprecated "x" syntax for shape is removed
* [nnef/opl] new i"..." syntax for escaping identifiers: i"some arbitrary string". Allow serialization of any ONNX model with any kind of string as node names.
* [ONNX] Signal processing operators (DTF, STFT, MelWeightMatrix, BlackmanWindow, HammingWindow, HannWindow)
* [ONNX] bitwise operations
* [ONNX] Compatibility target raised to operator set 18
# 0.18.3 - 2022-10-27
* [NNEF] Introduce a "resource" extension for loading values from a separate source (as a config file)
* Workaround for cpu detection failure on FreeBSD / arm64
* Various bug fixes
# 0.18.2 - 2022-10-18
* [pulse] improve convolution (and others) pulsification to avoid some unecessary buffering delay
* [cli] support multiple streaming inputs and outputs
* [ONNX] more relaxed Clip operator rules
# 0.18.1 - 2022-10-06
* prepare NNEF for further tract-opl extension (resource support)
* more generic matmul
* optimise some EinSum cases as matmul
# 0.18.0 - 2022-09-21
* [ONNX Breaking] Several changes to move towards supporting ONNX symbolic dimensions (actual fixes, but they may break stuff that was working more or less by accident). It may be required to erase output shapes explicitely when input shape is overriden on models that were working before.
* [CLI breaking] ONXN symbolic dimensions has some impact here too. --input-bundle is deprecated, is was overriden and ambiguous. Instead, there is a --input-facts-from-bundle global option, and a --input-from-bundle option in the subcommands run, profile, dump. --allow-random-input is also moved to subcommands. We think all previously supported behaviours are still there. Please open issues if not.
# 0.17.7 - 2022-09-05
* clippy up all tract code
* various fixes
* 0.17.5 and 0.17.6 are misfired
# 0.17.4 - 2022-08-11
* [cli] global --set (as a somehat cleaner --concretize successor) allow to set a symbol value after decluttering
* [cli] run --save-outputs output.npz to save execution outputs
* dozens of fixs and code cleanup (clippy-fication in progress)
# 0.17.3 - 2022-07-25
* [License] Allowing https://spdx.org/licenses/Unicode-DFS-2016.html (no tldr yet, but pretty similar to BSD-2)
* [Breaking] CLI --json option reports costs as strings instead of numbers (in order to allow symbolic values).
* Sigmoid/Tanh f32 reimpl, plus new f16 impl.
# 0.17.1 - 2022-07-11
* Sanitiser=address in the CI. Fixed a couple of overflow/memleaks. (Nothing looked too awful.)
* ONNX NonMaxSuppression
# 0.17.0 - 2022-06-13
* [Breaking] [ONNX-ML] TreeEnsembleClassifier with binary output (single class) now mimicks scikit-learn output layout.
# 0.16.9 - 2022-06-10
* bump ONNX protobuf file and support external tensors format
* new "skinny" kernels for avx2/fma f32 multiplication (positive impact on low, non 1 batch size for DNN-heavy loads)
# 0.16.7 - 2022-05-16
* Softmax is now an operator in core, coming with a direct quantized implementation
* new TypedFact constructor API ( f32::fact(&[1, 4, 12]), f32::fact(shape!(Symbol::from('N'), 12)))
* fixes and optimisation of re-quantization pipeline
* fixes around symbols in NNEF/OPL
# 0.16.6 - 2022-05-03
* Various changes around quantization support (qi32 appearance)
# 0.16.5 - 2022-04-27
* Intel optimisation are back
* Range is now more flexible, should unlock some BERT models with symbolic dimensions.
# 0.16.4 - 2022-04-14
* some optimisations in depthwise convolutions
* various bugfixes
* [Breaking] Fixed nnef "tile" operator definition ("repeats" is plural). As a consequence models using "tile" serialized with tract with prior versions can not be loaded anymore (and vice-versa).
# 0.16.3 - 2022-03-30
* [Breaking] tract-opl models Scan syntax changed a bit. Models exported by <0.16.2 are loadable in >=0.16.2, but not the other way around.
* Optimisation in deconv
# 0.16.1 - 2022-03-02
* [Breaking] Minimum Rust Supported Version is now 1.59.0
* [Breaking] Small API changes in model api: .compact(), .optimize(), .declutter() now take &mut self and work in place.
* [LICENSE] Only the licensing for dependencies of the top-level library crates (tensorflow, onnx, kaldi, pulse) will now be monitored. The command line tool (tract crate in cli folder) is for developpers (tract developpers or tract integrators), is not meant to be shipped to end-user, and it concentrates most of the license and dependency complexity.
* [LICENSE] BSD-3-Clause is now accepted in tract.
* Optimisations around convolutions and deconvolution
* Optimisation on Cortex-A53, first round of Cortex-A55 optimisation too.
# 0.15.8 - 2021-11-18
* Fix brand new ArrayFeatureExtractor inference
# 0.15.7 - 2021-11-16
* ONNX ArrayFeatureExtractor
* ConvTranspose/deconv optimisation
# 0.15.6 - yanked
* just a release script failure
# 0.15.5 - 2021-10-26
* hold half at 1.7.x for compat with rust 1.50
# 0.15.4 - 2021-10-21
* ConvTranspose/deconv pulse support
* ONNX SpaceToDepth/DepthToSpace
# 0.15.3 - 2021-07-29
* optimise i8*u8, u8*i8 and u8*u8 matrix products (and convo)
# 0.15.2 - 2021-07-09
* bump prost dep
# 0.15.1 - 2021-07-08
* some optimisations for arm32 (cortex-a7 and a9)
# 0.15.0 - 2021-06-24
* Switched the order of item_type and item_type_vendor in the NNEF tendor format to be consistent with NNEF-tools, and changed the item_type of integers due to an error in the specification. Breaking for tensor files containing integers or strings.
* Scan output batching optimisation
* Concat pulsification over a secondary axis
* new aarch64 16x4 f32 kernel
## 0.14.2 - 2021-05-27
* better handling of errors in ONNX parser
* fix/workaround some performance regressions bubling from recent ndarray changes
## 0.14.1 - 2021-05-18
* ONNX ConvTranspose, Gather, GatherND, GatherElements, Scatter, ScatterND, ScatterElements support (and NNEF deconv)
* Fixes around integer serialisation in NNEF
* workaround subtle breaking changes in ndarray (between 0.15.1 and 0.15.2)
## 0.14.0 - 2021-04-19
* low-level functions in linalg are now version tagged: two versions of tract can now co-exist in the same binary
* rustc minimal version is now 1.50
* dependencies version bumps (ndarray, itertools, and others)
## 0.13.2
* fix sigmoid and tanh variability on intel
## 0.13.1
* temporary disable binary unicast add fusing (too many bugs)
## 0.13.0
* Release are now "in sync": all tract crate versions on a build *must* be aligned
* optimisations, with a focus on aarch64
## 0.12.5 - 2021-01-12
* Dependency bumps
## 0.12.4 - 2021-01-06
* 0.12.3 is a misfire
* hotfixes on 0.12.2 new tree classifier
* fix X compilation from macos/aarch64 to macos/intel
## 0.12.2 - 2021-01-05
* ONNX-ML: CategoryMapper and TreeEnsembleClassifier (partial, SoftmaxZero and Probits are missing). With NNEF support.
* cargo-deny enforces licences choices
## 0.12.1 - 2020-12-11
* 0.12.0 is a misfire.
* API BREAKING: TypedFact::dt_shape & friends can not fail anymore, no longer return a result (remove `?`)
* Breaking: Rust minimal version bumped to 1.42
* Early, basic, correct but slow support for i8 by u8 matrix mult.
* Support for Apple Silicon, aka M1, aka aarch64 darwin (but not in CI yet)
* dynamic quantization convolution support
* release now ships cli musl builds for linux
* optimizations targetting small Cortex-A (like 7, 8, and 9)
* command line dump --profile --cost now computes flops
* ONNX: OneHot op support
## 0.11.2 - 2020-10-26
* ONNX: new op: DynamicQuantizeLinear
* tract-data crate split from core, containing tensor, dim, and datum types.
## 0.11.1 - 2020-10-20
* switch from error_chain to anyhow
* simplify trivial gathers to a slice
* generalize symbolic dimension a bit: support "2S" and the like
* deprecate "x" syntax in CLI, please use `,` instead
## 0.11.0
### Breaking
* NNEF: tract-nnef no longer performs gunziping, but expect an uncompressed tar
stream. We found out is it counter-productive (weights matrices are more or
less random, they do not compress easily, and decompression is expensive).
NNEF networks in the wild are .tgz file. Using flate2, decompression is a
one-liner, but it must be done by the client code now.
* bumped extended nnef compat version (unchecked at this stage) to "alpha1"
* move pulse operators and translation to their own crate and nnef registry
* generalize TDim to support an arbitrary number of symbols
* concretize_stream_dim is superseded by concrentize_dims
### Notable
* new crates, building on tract-opl introduction:
* *tract-pulse-opl*: pulse runtime (handful of ops, including Delay) is now separated from core
* *tract-onnx-opl*: onnx runtime (4 ops not belonging in core)
* *tract-pulse*: pulsification of models (model-translation time)
* tract-onnx is now limited to onnx model loading and conversion
## 0.10.10 - 2020-08-30
* load a NNEF as a TypedModel using tract_nnef, and from the CLI
* dump a tract TypedModel to NNEF (with extensions for op not nnef compatbile)
* not a full coverage of nnef, but enough for most CNN (image categorizers zoo working)
* 80% of onnx tests are surviving a NNEF dump and reload at this stage
## 0.10.0 - 2020-07-28
### ONNX
* covered operators compatible with Operator Sets 9, 10, 11 (new) and 12 (new)
### API Breaking
* Tensor::l1 method is gone
### Windows
* Support for -gnu targets (non-mvsc).
### Notable
* --cost now gives the number of parameters in the model
* SimpleState is clonable again (actually useful !)
## 0.9.2 - 2020-06-16
* introduce `TypedModel::method.concretize_stream_dim`
* various pulsification bugfixes
## 0.9.1 - 2020-06-16
* fix Reshape with TDim
## 0.9.0 - 2020-06-15
Still no shortage of version numbers...
### API Breakage
* NormalizedModel (and friends) are gone. They were only useful as a pre-pulse transformation pre-requisite that the current TypedModel (& co) meets.
* TypedModel::into_optimized() is gone. InferenceModel::into_optimized() stays as an end-to-end shortcut for simple cases. It does .into_typed()?.declutter()?.optimize()).
* TypedModel::codegen() is now ::optimize()
## 0.8.0 - 2020-06-13
I wish I had seen these issues yesterday. Anyway, version numbers are cheap.
* Bumping minimum rust to 1.41
## 0.7.0 - 2020-06-12
* CLI refactoring (hopefully stabilizing a bit?)
* `profile --bench` is now bench
* profile is now `dump --profile`
* cost is now `dump --cost`
* profiling is now done during a full net instead of per op
* new "compact" graph dumper, profile visual hints
* `dump --cost --profile --json` output profiling and cost information
* show logical names for ops instead of the Op struct names (not 100% sure it's right)
* criterion integration
* WASM support for tract-onnx and tract-tensorflow targets (CI)
* Convenience methods added to Models to allow model building in fluent style, up to Plan instantiation (SimplePlan now nicknamed RunnableModel). Non breaking.
* Support for ONNX bidi LSTM (CI), GRU and RNN (untested, consider alpha)
* Fixes around nets with a non trivial batch size (axis simplification code, matmul op fusion)
## 0.6.3 - 2020-04-25
* Lock ndarray version to dodge rustc/llvm issue (https://github.com/rust-lang/rust/issues/71506)
## 0.6.2 - 2020-04-15
* Use http://gihub.com/kali/readings for instrumentation.
## 0.6.0 - 2020-02-19
### Notable
* New jupyter/keras/tf example
* ARMv8 tanh / sigmoid optimisation
### API Breaking
* refactor exports and dependencies
* preferred way to use tract is now to `use tract_tensorflow::prelude::*;`
* singleton framework is built by `let tensorflow = tensorflow()`. The Framework trait is in the prelude too.
* the prelude contains a reexport of `tract_core`, and of ndarray as `tract_ndarray`
* no more need to declare dependency on `tract-core` and/or `tract-linalg` in Cargo.toml
* same goes for `tract_onnx`
## 0.5.9 - 2020-02-07
### Breaking
* Rustc minimum version is now 1.39
### Onnx
* Support for MatMulInteger, ConvInteger
* Support for QuantizeLinear DequantizeLinear
* Basic support for QLinearMatMul, QLinearConv
## 0.5.6 - 2019-10-30
### Tensorflow
* Initial support for GatherV2
### Onnx
* Fix PReLu normalization
## 0.5.5 - 2019-10-25
### Tensorflow
* Initial support for AddV2, Mean, Min, Prod, Sum
## 0.5.4 - 2019-09-30
### Notable
* Make Onnx loader operator set aware, and Slice-10 support.
* Cost now reports Delay ops buffer size
* Bump dependencies (protobuf) and fix codegen
* Windows CI now performs a top-level "cargo check"
## 0.5.1 - 2019-09-24
### Bugfix
* remove the no_panic checks, as too fragile (breaking non-lto builds)
## 0.5.0 - 2019-09-20
### Breaking
* Change tensor facts names for consistency: TensorFact is now InferenceFact.
### Notable
* Introduce Windows support, including CI coverage for linalg
* Switch from Travis to GitHub Actions
* Internal refactoring around tract-core canonic opset
* Tract CLI can now compute a FLOP number for networks ("cost" subcommand).
Furthermore the CI asserts its value for a few networks to prevent optimisation regressions.
* Fix: handling of -1 in ONNX Reshape op
## 0.4.2 - 2019-09-10
* Fix release script after 0.4.1 release disaster.
## 0.4.1 - 2019-09-09 [YANKED]
* Fix for OS where CARGO_CFG_TARGET_FAMILY is undefined
* Linear Algebra package refactor
* tract-core canonic operator set introduction
* significant performance boost (up to 20% on some real-life networks)
## 0.4.0 - 2019-07-30
* Start Kaldi networks support (LSTM, Renorm, Affine, downsample)
## Before...
This Changelog started way too late. But better late than never.
================================================
FILE: Cargo.toml
================================================
[workspace]
resolver = "2"
members = [
"data",
"linalg",
"core",
"pulse",
"pulse-opl",
"hir",
"nnef",
"nnef/cli",
"nnef/nnef-resources",
"tensorflow",
"tflite",
"onnx-opl",
"onnx",
"libcli",
"cli",
"gpu",
"metal",
"extra",
"transformers",
"cuda",
"api",
"api/rs",
"api/ffi",
"api/proxy",
"api/proxy/sys",
"examples/face_detection_yolov8onnx_example",
"examples/face_similarity_arcface_onnx",
"examples/tensorflow-mobilenet-v2",
"examples/tflite-mobilenet-v3",
"examples/keras-tract-tf2",
"examples/nemo-parakeet-asr",
"examples/nemo-nemotron-asr",
"examples/nnef-dump-mobilenet-v2",
"examples/nnef-mobilenet-v2",
"examples/nnef-mobilenet-v2-api",
"examples/onnx-mobilenet-v2",
"examples/pytorch-albert-v2",
"examples/pytorch-resnet",
"examples/causal_llm",
"examples/stable-diffusion",
"examples/stable-diffusion-3",
"examples/stable-diffusion-xl",
"harness/core-proptest-pulse",
"harness/nnef-inceptionv3",
"harness/tf-inceptionv3",
"harness/tf-mobilenet-v2",
"harness/tfl-mobilenet-v2-q",
"test-rt/infra",
"test-rt/suite-unit",
"test-rt/suite-onnx",
"test-rt/test-f16",
"test-rt/test-blas",
"test-rt/test-metal",
"test-rt/test-cuda",
"test-rt/test-unit-core",
"test-rt/test-onnx-core",
"test-rt/test-nnef-cycle",
"test-rt/test-tflite"
]
# same, without metal, test-metal, cuda, test-cuda and test-tflite which are probelematic on specific targets
default-members = [
"data",
"linalg",
"core",
"pulse",
"pulse-opl",
"hir",
"nnef",
"nnef/cli",
"nnef/nnef-resources",
"tensorflow",
"tflite",
"onnx-opl",
"onnx",
"libcli",
"cli",
"extra",
"transformers",
"api",
"api/rs",
"api/ffi",
"examples/face_detection_yolov8onnx_example",
"examples/face_similarity_arcface_onnx",
"examples/tensorflow-mobilenet-v2",
"examples/tflite-mobilenet-v3",
"examples/keras-tract-tf2",
"examples/nnef-dump-mobilenet-v2",
"examples/nnef-mobilenet-v2",
"examples/onnx-mobilenet-v2",
"examples/pytorch-albert-v2",
"examples/pytorch-resnet",
"harness/core-proptest-pulse",
"harness/nnef-inceptionv3",
"harness/tf-inceptionv3",
"harness/tf-mobilenet-v2",
"harness/tfl-mobilenet-v2-q",
"test-rt/infra",
"test-rt/suite-unit",
"test-rt/suite-onnx",
"test-rt/test-f16",
"test-rt/test-blas",
"test-rt/test-unit-core",
"test-rt/test-onnx-core",
"test-rt/test-nnef-cycle",
]
[workspace.package]
rust-version = "1.91"
[workspace.dependencies]
accelerate-src = "0.3"
anstyle = "1.0.2"
anstyle-parse = "1.0.0"
anstyle-query = "1.0.0"
anyhow = "1.0.43"
anymap3 = "1.0"
approx = "0.5"
atty = "0.2.14"
bit-set = "0.10.0"
boow = "0.1.3"
box_drawing = "0.1.2"
byteorder = "1.4.3"
bytes = "1.0.1"
cc = "1.0.69"
clap = { version = "4", features = [ "cargo", "derive" ] }
colorous = "1.0.5"
core_affinity = "0.8.0"
criterion = "0.8"
cudarc = { version = "0.19", features = ["dynamic-loading", "f16", "cudnn"] }
derive-new = "0.7"
dinghy-test = "0.8"
dirs = "6.0.0"
downcast-rs = "2.0"
dyn-clone = "1.0.4"
dyn-eq = "0.1"
dyn-hash = "1.0"
env_logger = "0.11"
erased-serde = "0.4"
flatbuffers = "25.12.19"
flate2 = "1.0.20"
float-ord = "0.3.2"
fs-err = "3"
fs2 = "0.4.3"
getrandom = "0.4"
half = { version=">=2.4,<3.0", features = [ "std", "num-traits" ] }
home = "=0.5.12"
icu_normalizer = "2.1"
icu_normalizer_data = "2.1"
icu_properties = "2.1"
icu_properties_data = "2.1"
idna_adapter = "1.2.0"
image = "0.25"
inventory = "0.3.21"
itertools = "0.14"
lazy_static = "1.5.0"
libc = "0.2.164"
libloading = "0.9"
libm = "0.2.11"
liquid = "0.26.8"
liquid-core = "0.26.8"
liquid-derive = "0.26.8"
litemap = "0.8"
log = "0.4.14"
maplit = "1.0.2"
memmap2 = "0.9"
metal = { version = "0.33.0" }
ndarray = "0.17"
ndarray-npy = { version = "0.10", features = [ "compressed_npz" ] }
nom = "8.0.0"
nom-language = "0.1"
nu-ansi-term = "0.50"
num-complex = "0.4.0"
num-integer = "0.1.44"
num-traits = "0.2.14"
num_cpus = "1"
openblas-src = { version = "0.10", features = ["static"] }
pastey = "0.2"
proptest = "1.0.0"
prost = "0.14"
prost-types = "0.14"
py_literal = "0.4.0"
rand = "0.10"
rand_distr = "0.6"
rayon = "1.10"
readings-probe = "0.1.8"
regex = "1.5.4"
ron = "0.12"
reqwest = { version = "0.13", features = [ "blocking", "rustls-no-provider" ], default-features = false }
rustfft = { version = "6.1", features = [ "neon" ] }
rustls = { version = "0.23", default-features = false, features = [ "ring", "std", "tls12" ] }
webpki-roots = "1"
safetensors = "0.7"
scan_fmt = "0.2.6"
serde = { version = "1.0.127", features = [ "derive" ] }
serde_json = "1.0"
simd-adler32 = { version = "0.3.7", features = ["std"] }
smallvec = "1.6.1"
string-interner = "0.19"
tar = "0.4.37"
tempfile = "3.8"
tensorflow = "0.21.0"
tflitec = { git = "https://github.com/kali/tflitec-rs.git", rev="9ceb838" }
time = "0.3.23"
tokenizers = "0.22"
unicode-normalization = "0.1.19"
walkdir = "2.3.2"
zerofrom = "0.1.5"
tract-api = { version = "0.23.0-pre", path = 'api' }
tract-core = { version = "0.23.0-pre", path = 'core' }
tract-cuda = { version = "0.23.0-pre", path = 'cuda' }
tract-data = { version = "0.23.0-pre", path = 'data' }
tract-extra = { version = "0.23.0-pre", path = 'extra' }
tract-gpu = { version = "0.23.0-pre", path = 'gpu' }
tract-hir = { version = "0.23.0-pre", path = 'hir' }
tract-libcli = { version = "0.23.0-pre", path = 'libcli' }
tract-linalg = { version = "0.23.0-pre", path = 'linalg' }
tract-metal = { version = "0.23.0-pre", path = 'metal' }
tract-nnef-resources = { version = "0.23.0-pre", path = 'nnef/nnef-resources' }
tract-nnef = { version = "0.23.0-pre", path = 'nnef' }
tract-onnx-opl = { version = "0.23.0-pre", path = 'onnx-opl' }
tract-onnx = { version = "0.23.0-pre", path = 'onnx' }
tract-pulse-opl = { version = "0.23.0-pre", path = 'pulse-opl' }
tract-pulse = { version = "0.23.0-pre", path = 'pulse' }
tract-tensorflow = { version = "0.23.0-pre", path = 'tensorflow' }
tract-tflite = { version = "0.23.0-pre", path = 'tflite' }
tract-transformers = { version = "0.23.0-pre", path = 'transformers' }
tract = { version = "0.23.0-pre", path = 'api/rs' }
tract-proxy-sys = { version = "0.23.0-pre", path = 'api/proxy/sys' }
tract-cli = { version = "0.23.0-pre", path = 'cli' }
tract-ffi = { version = "0.23.0-pre" }
tract-proxy = { version = "0.23.0-pre" }
[profile.opt-no-lto]
inherits="release"
lto=false
[profile.release]
# debug = true
lto = true
[profile.bench]
debug = true
[profile.dev.package."*"]
opt-level = 2
[profile.dev.build-override]
debug = false
# strip = "debuginfo" does not work on android and ios
incremental = false
================================================
FILE: LICENSE
================================================
## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
================================================
FILE: LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: LICENSE-MIT
================================================
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================




[](https://github.com/snipsco/tract/actions)
[](https://github.com/snipsco/tract/actions)
[](https://docs.rs/tract-core)
[](https://pypi.org/project/tract/)
Sonos' Neural Network inference engine.
_This project used to be called tfdeploy, or Tensorflow-deploy-rust._
## What ?
`tract` is a Neural Network inference toolkit. It can read ONNX or NNEF, optimize them and run them.
## Quick start, examples
* [MobileNet v2 with ONNX](examples/onnx-mobilenet-v2)
* [BERT example with ONNX](examples/pytorch-albert-v2)
* [MobileNet v2 with TensorFlow](examples/tensorflow-mobilenet-v2)
* [From Keras and TensorFlow 2 to tract](examples/keras-tract-tf2)
* [ResNet with PyTorch](examples/pytorch-resnet)
There is also [some technical documentation](doc/) and [blog](https://tech-blog.sonos.com/posts/optimising-a-neural-network-for-inference/) posts.
## Tract in the landscape
### ONNX
As of today, `tract` passes successfully about 85% of ONNX backends
tests. All "real life" integration tests in ONNX test suite are passing:
bvlc_alexnet, densenet121, inception_v1, inception_v2, resnet50, shufflenet,
squeezenet, vgg19, zfnet512.
Notable missing parts are operators dealing with Tensor Sequences and Optional Tensors : tract /really/ wants to flow Tensors and nothing else.
This is structural. Changing it would be pretty difficult, and it's unclear whether it can be done without impairing performance or maintainability.
We are not convinced these features have shown their interest in the wild yet, so we prefer to leave them aside.
Other dark corners are specific operators like "Resize" which fit perfectly in the framework but need a complex internal logic that is far
from our core business. In these cases, we are happy to accept contributions and to help.
The following operators are implemented and tested.
Abs, Acos, Acosh, Add, And, ArgMax, ArgMin, ArrayFeatureExtractor, Asin, Asinh, Atan, Atanh, AveragePool, BatchNormalization, BitShift, BitwiseAnd, BitwiseNot, BitwiseOr, BitwiseXor, BlackmanWindow, Cast, CastLike, CategoryMapper, Ceil, Clip, Compress, Concat, Constant, ConstantLike, ConstantOfShape, Conv, ConvInteger, ConvTranspose, Cos, Cosh, CumSum, DFT, DepthToSpace, DequantizeLinear, Div, Dropout, DynamicQuantizeLinear, Einsum, Elu, Equal, Erf, Exp, Expand, EyeLike, Flatten, Floor, GRU, Gather, GatherElements, GatherND, Gemm, GlobalAveragePool, GlobalLpPool, GlobalMaxPool, Greater, GreaterOrEqual, HammingWindow, HannWindow, HardSigmoid, Hardmax, Identity, If, InstanceNormalization, IsInf, IsNaN, LRN, LSTM, LeakyRelu, Less, LessOrEqual, Log, LogSoftmax, MatMul, MatMulInteger, Max, MaxPool, Mean, MelWeightMatrix, Min, Mod, Mul, Multinomial, Neg, NonMaxSuppression, NonZero, Not, OneHot, Or, PRelu, Pad, ParametricSoftplus, Pow, QLinearConv, QLinearMatMul, QuantizeLinear, RNN, RandomNormal, RandomNormalLike, RandomUniform, RandomUniformLike, Range, Reciprocal, ReduceL1, ReduceL2, ReduceLogSum, ReduceLogSumExp, ReduceMax, ReduceMean, ReduceMin, ReduceProd, ReduceSum, ReduceSumSquare, Relu, Reshape, Resize, Round, Rsqrt, STFT, ScaledTanh, Scan, Scatter, ScatterElements, ScatterND, Selu, Shape, Shrink, Sigmoid, Sign, Sin, Sinh, Size, Slice, Softmax, Softplus, Softsign, SpaceToDepth, Split, Sqrt, Squeeze, Sub, Sum, Tan, Tanh, ThresholdedRelu, Tile, Transpose, TreeEnsembleClassifier, Unsqueeze, Where, Xor
We test these operators against from ONNX 1.4.1 (operator set 9), up to ONNX 1.13.0 (operator set 18).
We are using ONNX test suite, but it does not cover everything.
We also deliberately ignore some tests, or restricting their scope depending on what we feel is realistic.
Sometimes these decisions are just wrong, and sometimes they become wrong as time goes by and the fields moves in unexpected directions.
So if you are puzzled by an ONNX model that does not work in tract, we are happy to take a look.
### NNEF
Long story short, TensorFlow and ONNX formats are good for designing and
training networks. They need to move fast to follow the research field, tend to
integrate new features and operators greedily. They also exhibit a high level
of expressivity to facilitate network design.
On the other hand, only a subset of operators and network features actually
reach production, so systems running production network do not have to deal
with so many operators. Furthermore, some information required for training can
be stripped from the network before going to production for prediction.
NNEF tries to bridge the gap between training frameworks and inference by
proposing a format dedicated to production and prediction.
Tract supports NNEF:
* tract_nnef can load and execute NNEF networks
* tract supports most of the NNEF specification, the most notable exception
being the ROI operators
* tract introduces tract-OPL, a series of NNEF extensions to support other
operators (or extend some operators semantics) in order to represent the
full range of tract-core neural network support: any network understood by
tract should be serializable to tract-OPL. This is a work in progress.
* tract command line can translate networks from TensorFlow or ONNX to NNEF/OPL.
### tract-opl version compatibility
A remainder: NNEF is not expressive enough to represent all ONNX. tract-OPL extends
NNEF using proprietary to support what is missing. Notable extensions are pulse
operators, recurring operators (as Scan) and symbolic extensions.
There is no strict check in place here, so... implementation is not bullet proof.
* NNEF part aims at being very stable. It is strongly constrained with compatibility
with NNEF specification.
* tract-opl is a bit more in flux. Nevertheless we try to maintain the following
golden rule:
`models serialized with tract 0.x.y should work with tract 0.x.z where z >= y`
* in practice, breaking changes have been relatively rare so far. Most models are
forward and retro compatible from when tract has acquired NNEF support.
Notable breakage occurred:
* 0.16.3 (forward compatible) on Scan operator
* 0.17.0 for binary decision tree classifier
Starting with `0.17.0`, a model property is injected in tract-opl files (`tract_nnef_ser_version`)
to tag which version of tract generated the file. As most models will remain compatible,
tract will not do any version check. It is up to the application developer to do so.
A softer version tag exists as `tract_nnef_format_version`. pre-0.17.0 version set it to
`alpha1`, post-0.17.0 set it `beta1`. Don't put too much emphasis into the "alpha-ness" naming
of versions here.
### Note: support for TensorFlow 1.x
Even if `tract` is very far from supporting any arbitrary model, it can run
Google Inception v3 and Snips wake word models. Missing operators are relatively
easy to add. The lack of easy to reuse test suite, and the wide diversity of
operators in Tensorflow make it difficult to target a full support.
The following operators are implemented and tested:
Abs, Add, AddN, AddV2, Assign, AvgPool, BatchToSpaceND, BiasAdd, BlockLSTM, Cast, Ceil, ConcatV2, Const, Conv2D, DepthwiseConv2dNative, Div, Enter, Equal, Exit, ExpandDims, FakeQuantWithMinMaxVars, Fill, FloorMod, FusedBatchNorm, GatherNd, GatherV2, Greater, GreaterEqual, Identity, Less, LessEqual, Log, LogicalAnd, LogicalOr, LoopCond, MatMul, Max, MaxPool, Maximum, Mean, Merge, Min, Minimum, Mul, Neg, NoOp, Pack, Pad, Placeholder, Pow, Prod, RandomUniform, RandomUniformInt, Range, RealDiv, Relu, Relu6, Reshape, Rsqrt, Shape, Sigmoid, Slice, Softmax, SpaceToBatchND, Squeeze, StridedSlice, Sub, Sum, Switch, Tanh, Tile, Transpose, VariableV2
Additionally, the complexity of TensorFlow 2 make it very unlikely that a direct
support will ever exist in tract. But many TensorFlow 2 models can be
converted to ONNX and then loaded in tract.
## Example of supported networks
These models among others, are used to track tract performance evolution as
part of the Continuous Integration jobs. See [.travis/README.md](readme) and
[.travis/bundle-entrypoint.sh](.travis/bundle-entrypoint.sh) for more
information.
### Keyword spotting on Arm Cortex-M Microcontrollers
https://github.com/ARM-software/ML-KWS-for-MCU
ARM demonstrated the capabilities of the Cortex-M family by providing
tutorials and pre-trained models for keyword spotting. While the exercise
is ultimately meant for micro-controllers, `tract` can run the intermediate
TensorFlow models.
For instance, on a Raspberry Pi Zero, the "CNN M" model runs in about 70
micro-seconds, and 11 micro-seconds on a Raspberry Pi 3.
### Snips wake word models
https://arxiv.org/abs/1811.07684
Snips uses `tract` to run the wake word detectors. While earlier models were
class-based and did not require any special treatment, `tract` pulsing
capabilities made it possible to run WaveNet models efficiently enough for a
Raspberry Pi Zero.
### Inception v3
| Device | Family | TensorFlow-lite | tract |
|---------------------|----------------|-------------------|---------|
| Raspberry Pi Zero | Armv6 VFP | 113s | 39s |
| Raspberry Pi 2 | Armv7 NEON | 25s | 7s |
| Raspberry Pi 3 | aarch32 NEON | 5s | 5s |
Notes:
* while the Raspberry Pi 3 is an Armv8 device, this bench is running
on Raspbian, an armv6 operating system, crippling the performance
of both benches
* there exists other benches on the internet that show better
performance results for TensorFlow (not -Lite) on the Pi 3.
They use all four cores of the device. Both TensorFlow-Lite and tract
here have been made to run on a single-core.
# License
Note: files in the `tensorflow/protos` directory are copied from the
[TensorFlow](https://github.com/tensorflow/tensorflow) project and are not
covered by the following licence statement.
Note: files in the `onnx/protos` directory are copied from the
[ONNX](https://github.com/onnx/onnx) project and are not
covered by the following license statement.
## Apache 2.0/MIT
All original work licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contribution
Unless you explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
================================================
FILE: api/.gitignore
================================================
*.nnef.tgz
*.onnx
================================================
FILE: api/Cargo.toml
================================================
[package]
name = "tract-api"
version = "0.23.0-pre"
license = "MIT OR Apache-2.0"
authors = ["Mathieu Poumeyrol <kali@zoy.org>"]
description = "Tiny, no-nonsense, self contained, TensorFlow and ONNX inference"
repository = "https://github.com/sonos/tract"
keywords = [ "NeuralNetworks" ]
categories = [ "science" ]
autobenches = false
edition = "2024"
rust-version.workspace = true
include = [ "Cargo.toml", "src/**/*.rs", "LICENSE*", "tract.h" ]
[dependencies]
anyhow.workspace = true
boow.workspace = true
flate2.workspace = true
half.workspace = true
ndarray.workspace = true
serde.workspace = true
serde_json.workspace = true
[features]
complex = []
[dev-dependencies]
lazy_static = "1.4.0"
reqwest.workspace = true
tempfile.workspace = true
================================================
FILE: api/LICENSE
================================================
## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
================================================
FILE: api/LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: api/LICENSE-MIT
================================================
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================
FILE: api/c/.gitignore
================================================
*.h
*.so
mobilenet
mobilenet_v2_1.0.onnx.nnef.tgz
================================================
FILE: api/c/Makefile
================================================
run: mobilenet mobilenet_v2_1.0.onnx.nnef.tgz
LD_LIBRARY_PATH=. ./mobilenet
clean:
rm -f mobilenet libtract.so tract.h
mobilenet: tract.h libtract.so mobilenet.c
cc mobilenet.c -o mobilenet -L. -ltract
libtract.so:
cargo build -p tract-ffi --profile opt-no-lto
cp ../../target/opt-no-lto/libtract.so .
tract.h:
cd ../ffi ; cbindgen -l c > tract.h
cp ../ffi/tract.h .
mobilenet_v2_1.0.onnx.nnef.tgz:
wget -q https://s3.amazonaws.com/tract-ci-builds/tests/mobilenet_v2_1.0.onnx.nnef.tgz
================================================
FILE: api/c/mobilenet.c
================================================
#include "tract.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#define check(call) \
{ \
TRACT_RESULT result = call; \
if (result == TRACT_RESULT_KO) { \
fprintf(stderr, "Error calling tract: %s", \
tract_get_last_error()); \
exit(1); \
} \
}
int main() {
// Initialize nnef parser
TractNnef *nnef = NULL;
check(tract_nnef_create(&nnef));
assert(nnef);
// Load the model
TractModel *model = NULL;
check(tract_nnef_load(nnef, "mobilenet_v2_1.0.onnx.nnef.tgz", &model));
assert(model);
assert(nnef);
// once the model is build, the framework is not necessary anymore
check(tract_nnef_destroy(&nnef));
assert(!nnef);
// Pick a runtime
TractRuntime *runtime = NULL;
check(tract_runtime_for_name("default", &runtime));
assert(runtime);
// Make the model runnable
TractRunnable *runnable = NULL;
check(tract_runtime_prepare(runtime, &model, &runnable));
assert(runnable);
assert(!model);
float *image = malloc(3 * 224 * 224 * sizeof(float));
FILE *fd = fopen("grace_hopper_3_224_224.f32.raw", "rb");
assert(fread(image, sizeof(float), 3 * 224 * 224, fd) == 3 * 224 * 224);
fclose(fd);
TractTensor *input = NULL;
size_t shape[] = {1, 3, 224, 224};
check(
tract_tensor_from_bytes(TRACT_DATUM_TYPE_F32, 4, shape, image, &input));
free(image);
TractTensor *output = NULL;
// simple stateless run...
check(tract_runnable_run(runnable, &input, &output));
const float *data = NULL;
check(tract_tensor_as_bytes(output, NULL, NULL, NULL, (const void **)&data));
float max = data[0];
int argmax = 0;
for (int i = 0; i < 1000; i++) {
float val = data[i];
if (val > max) {
max = val;
argmax = i;
}
}
printf("Max is %f for category %d\n", max, argmax);
check(tract_tensor_destroy(&output));
// or spawn a state to run the model
TractState *state = NULL;
check(tract_runnable_spawn_state(runnable, &state));
assert(state);
// runnable is refcounted by the spawned states, so we can release it now.
check(tract_runnable_release(&runnable));
assert(!runnable);
check(tract_state_run(state, &input, &output));
check(tract_tensor_as_bytes(output, NULL, NULL, NULL, (const void **)&data));
assert(data[argmax] == max);
check(tract_tensor_destroy(&output));
// done with out state and input
check(tract_state_destroy(&state));
check(tract_tensor_destroy(&input));
}
================================================
FILE: api/ffi/Cargo.toml
================================================
[package]
name = "tract-ffi"
version = "0.23.0-pre"
license = "MIT OR Apache-2.0"
authors = ["Mathieu Poumeyrol <kali@zoy.org>"]
description = "Tiny, no-nonsense, self contained, neural network inference"
repository = "https://github.com/snipsco/tract"
keywords = [ "TensorFlow", "NeuralNetworks" ]
categories = [ "science" ]
autobenches = false
edition = "2024"
include = [ "Cargo.toml", "src/**/*.rs", "LICENSE*" ]
[lib]
name = "tract"
crate-type = ["cdylib"]
[badges]
maintenance = { status = "actively-developed" }
[dependencies]
anyhow.workspace = true
flate2.workspace = true
serde.workspace = true
serde_json.workspace = true
tract-api.workspace = true
tract-rs = { version = "0.23.0-pre", path = "../rs", package = "tract" }
================================================
FILE: api/ffi/cbindgen.toml
================================================
language = "C"
after_includes = """
typedef enum DatumType {
TRACT_DATUM_TYPE_BOOL = 1,
TRACT_DATUM_TYPE_U8 = 17,
TRACT_DATUM_TYPE_U16 = 18,
TRACT_DATUM_TYPE_U32 = 20,
TRACT_DATUM_TYPE_U64 = 24,
TRACT_DATUM_TYPE_I8 = 33,
TRACT_DATUM_TYPE_I16 = 34,
TRACT_DATUM_TYPE_I32 = 36,
TRACT_DATUM_TYPE_I64 = 40,
TRACT_DATUM_TYPE_F16 = 50,
TRACT_DATUM_TYPE_F32 = 52,
TRACT_DATUM_TYPE_F64 = 56,
TRACT_DATUM_TYPE_COMPLEX_I16 = 66,
TRACT_DATUM_TYPE_COMPLEX_I32 = 68,
TRACT_DATUM_TYPE_COMPLEX_I64 = 72,
TRACT_DATUM_TYPE_COMPLEX_F16 = 82,
TRACT_DATUM_TYPE_COMPLEX_F32 = 84,
TRACT_DATUM_TYPE_COMPLEX_F64 = 88,
} DatumType;
"""
================================================
FILE: api/ffi/src/lib.rs
================================================
#![allow(clippy::missing_safety_doc)]
use anyhow::{Context, Result};
use std::cell::RefCell;
use std::ffi::{CStr, CString, c_char, c_void};
use tract_api::{
AsFact, DatumType, DimInterface, FactInterface, InferenceModelInterface, ModelInterface,
NnefInterface, OnnxInterface, RunnableInterface, RuntimeInterface, StateInterface,
TensorInterface,
};
use tract_rs::{State, Tensor};
/// Used as a return type of functions that can encounter errors.
/// If the function encountered an error, you can retrieve it using the `tract_get_last_error`
/// function
#[repr(C)]
#[allow(non_camel_case_types)]
#[derive(Debug, PartialEq, Eq)]
pub enum TRACT_RESULT {
/// The function returned successfully
TRACT_RESULT_OK = 0,
/// The function returned an error
TRACT_RESULT_KO = 1,
}
thread_local! {
pub(crate) static LAST_ERROR: RefCell<Option<CString>> = const { RefCell::new(None) };
}
fn wrap<F: FnOnce() -> anyhow::Result<()>>(func: F) -> TRACT_RESULT {
match func() {
Ok(_) => TRACT_RESULT::TRACT_RESULT_OK,
Err(e) => {
let msg = format!("{e:?}");
if std::env::var("TRACT_ERROR_STDERR").is_ok() {
eprintln!("{msg}");
}
LAST_ERROR.with(|p| {
*p.borrow_mut() = Some(CString::new(msg).unwrap_or_else(|_| {
CString::new("tract error message contains 0, can't convert to CString")
.unwrap()
}))
});
TRACT_RESULT::TRACT_RESULT_KO
}
}
}
/// Retrieve the last error that happened in this thread. A function encountered an error if
/// its return type is of type `TRACT_RESULT` and it returned `TRACT_RESULT_KO`.
///
/// # Return value
/// It returns a pointer to a null-terminated UTF-8 string that will contain the error description.
/// Rust side keeps ownership of the buffer. It will be valid as long as no other tract calls is
/// performed by the thread.
/// If no error occured, null is returned.
#[unsafe(no_mangle)]
pub extern "C" fn tract_get_last_error() -> *const std::ffi::c_char {
LAST_ERROR.with(|msg| msg.borrow().as_ref().map(|s| s.as_ptr()).unwrap_or(std::ptr::null()))
}
/// Returns a pointer to a static buffer containing a null-terminated version string.
///
/// The returned pointer must not be freed.
#[unsafe(no_mangle)]
pub extern "C" fn tract_version() -> *const std::ffi::c_char {
unsafe {
CStr::from_bytes_with_nul_unchecked(concat!(env!("CARGO_PKG_VERSION"), "\0").as_bytes())
.as_ptr()
}
}
/// Frees a string allocated by libtract.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_free_cstring(ptr: *mut std::ffi::c_char) {
unsafe {
if !ptr.is_null() {
let _ = CString::from_raw(ptr);
}
}
}
macro_rules! check_not_null {
($($ptr:expr),*) => {
$(
if $ptr.is_null() {
anyhow::bail!(concat!("Unexpected null pointer ", stringify!($ptr)));
}
)*
}
}
macro_rules! release {
($ptr:expr) => {
wrap(|| unsafe {
check_not_null!($ptr, *$ptr);
let _ = Box::from_raw(*$ptr);
*$ptr = std::ptr::null_mut();
Ok(())
})
};
}
// NNEF
pub struct TractNnef(tract_rs::Nnef);
/// Creates an instance of an NNEF framework and parser that can be used to load and dump NNEF models.
///
/// The returned object should be destroyed with `tract_nnef_destroy` once the model
/// has been loaded.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_create(nnef: *mut *mut TractNnef) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef);
*nnef = Box::into_raw(Box::new(TractNnef(tract_rs::nnef()?)));
Ok(())
})
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_enable_tract_core(nnef: *mut TractNnef) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef);
(*nnef).0.enable_tract_core()
})
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_enable_tract_extra(nnef: *mut TractNnef) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef);
(*nnef).0.enable_tract_extra()
})
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_enable_tract_transformers(
nnef: *mut TractNnef,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef);
(*nnef).0.enable_tract_transformers()
})
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_enable_onnx(nnef: *mut TractNnef) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef);
(*nnef).0.enable_onnx()
})
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_enable_pulse(nnef: *mut TractNnef) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef);
(*nnef).0.enable_pulse()
})
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_enable_extended_identifier_syntax(
nnef: *mut TractNnef,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef);
(*nnef).0.enable_extended_identifier_syntax()
})
}
/// Destroy the NNEF parser. It is safe to detroy the NNEF parser once the model had been loaded.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_destroy(nnef: *mut *mut TractNnef) -> TRACT_RESULT {
release!(nnef)
}
/// Parse and load an NNEF model as a tract TypedModel.
///
/// `path` is a null-terminated utf-8 string pointer. It can be an archive (tar or tar.gz file) or a
/// directory.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_load(
nnef: *const TractNnef,
path: *const c_char,
model: *mut *mut TractModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef, model, path);
*model = std::ptr::null_mut();
let path = CStr::from_ptr(path).to_str()?;
let m = Box::new(TractModel(
(*nnef).0.load(path).with_context(|| format!("opening file {path:?}"))?,
));
*model = Box::into_raw(m);
Ok(())
})
}
/// Parse and load an NNEF buffer as a tract TypedModel.
///
/// `data` is a buffer pointer
/// `len` ise the buffer len
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_load_buffer(
nnef: *const TractNnef,
data: *const c_void,
len: usize,
model: *mut *mut TractModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef, model, data);
*model = std::ptr::null_mut();
let slice = std::slice::from_raw_parts(data as *const u8, len);
let m = Box::new(TractModel((*nnef).0.load_buffer(slice)?));
*model = Box::into_raw(m);
Ok(())
})
}
/// Dump a TypedModel as a NNEF tar file.
///
/// `path` is a null-terminated utf-8 string pointer to the `.tar` file to be created.
///
/// This function creates a plain, non-compressed, archive.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_write_model_to_tar(
nnef: *const TractNnef,
path: *const c_char,
model: *const TractModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef, model, path);
let path = CStr::from_ptr(path).to_str()?;
(*nnef).0.write_model_to_tar(path, &(*model).0)?;
Ok(())
})
}
/// Dump a TypedModel as a NNEF .tar.gz file.
///
/// `path` is a null-terminated utf-8 string pointer to the `.tar.gz` file to be created.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_write_model_to_tar_gz(
nnef: *const TractNnef,
path: *const c_char,
model: *const TractModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef, model, path);
let path = CStr::from_ptr(path).to_str()?;
(*nnef).0.write_model_to_tar_gz(path, &(*model).0)?;
Ok(())
})
}
/// Dump a TypedModel as a NNEF directory.
///
/// `path` is a null-terminated utf-8 string pointer to the directory to be created.
///
/// This function creates a plain, non-compressed, archive.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_nnef_write_model_to_dir(
nnef: *const TractNnef,
path: *const c_char,
model: *const TractModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(nnef, model, path);
let path = CStr::from_ptr(path).to_str()?;
(*nnef).0.write_model_to_dir(path, &(*model).0)?;
Ok(())
})
}
// ONNX
pub struct TractOnnx(tract_rs::Onnx);
/// Creates an instance of an ONNX framework and parser that can be used to load models.
///
/// The returned object should be destroyed with `tract_nnef_destroy` once the model
/// has been loaded.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_onnx_create(onnx: *mut *mut TractOnnx) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(onnx);
*onnx = Box::into_raw(Box::new(TractOnnx(tract_rs::onnx()?)));
Ok(())
})
}
/// Destroy the NNEF parser. It is safe to detroy the NNEF parser once the model had been loaded.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_onnx_destroy(onnx: *mut *mut TractOnnx) -> TRACT_RESULT {
release!(onnx)
}
/// Parse and load an ONNX model as a tract InferenceModel.
///
/// `path` is a null-terminated utf-8 string pointer. It must point to a `.onnx` model file.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_onnx_load(
onnx: *const TractOnnx,
path: *const c_char,
model: *mut *mut TractInferenceModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(onnx, path, model);
*model = std::ptr::null_mut();
let path = CStr::from_ptr(path).to_str()?;
let m = Box::new(TractInferenceModel((*onnx).0.load(path)?));
*model = Box::into_raw(m);
Ok(())
})
}
/// Parse and load an ONNX buffer as a tract InferenceModel.
///
/// `data` is a buffer pointer
/// `len` ise the buffer len
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_onnx_load_buffer(
onnx: *const TractOnnx,
data: *const c_void,
len: usize,
model: *mut *mut TractInferenceModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(onnx, model, data);
*model = std::ptr::null_mut();
let slice = std::slice::from_raw_parts(data as *const u8, len);
let m = Box::new(TractInferenceModel((*onnx).0.load_buffer(slice)?));
*model = Box::into_raw(m);
Ok(())
})
}
// INFERENCE MODEL
pub struct TractInferenceModel(tract_rs::InferenceModel);
/// Query an InferenceModel input counts.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_input_count(
model: *const TractInferenceModel,
inputs: *mut usize,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, inputs);
let model = &(*model).0;
*inputs = model.input_count()?;
Ok(())
})
}
/// Query an InferenceModel output counts.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_output_count(
model: *const TractInferenceModel,
outputs: *mut usize,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, outputs);
let model = &(*model).0;
*outputs = model.output_count()?;
Ok(())
})
}
/// Query the name of a model input.
///
/// The returned name must be freed by the caller using tract_free_cstring.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_input_name(
model: *const TractInferenceModel,
input: usize,
name: *mut *mut c_char,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, name);
*name = std::ptr::null_mut();
let m = &(*model).0;
*name = CString::new(&*m.input_name(input)?)?.into_raw();
Ok(())
})
}
/// Query the name of a model output.
///
/// The returned name must be freed by the caller using tract_free_cstring.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_output_name(
model: *const TractInferenceModel,
output: usize,
name: *mut *mut i8,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, name);
*name = std::ptr::null_mut();
let m = &(*model).0;
*name = CString::new(&*m.output_name(output)?)?.into_raw() as _;
Ok(())
})
}
/// Query a model input fact.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_input_fact(
model: *const TractInferenceModel,
input_id: usize,
fact: *mut *mut TractInferenceFact,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, fact);
*fact = std::ptr::null_mut();
let f = (*model).0.input_fact(input_id)?;
*fact = Box::into_raw(Box::new(TractInferenceFact(f)));
Ok(())
})
}
/// Set an input fact of an InferenceModel.
///
/// The `fact` argument is only borrowed by this function, it still must be destroyed.
/// `fact` can be set to NULL to erase the current output fact of the model.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_set_input_fact(
model: *mut TractInferenceModel,
input_id: usize,
fact: *const TractInferenceFact,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model);
let f = fact.as_ref().map(|f| &f.0).cloned().unwrap_or_default();
(*model).0.set_input_fact(input_id, f)?;
Ok(())
})
}
/// Query an output fact for an InferenceModel.
///
/// The return model must be freed using `tract_inference_fact_destroy`.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_output_fact(
model: *const TractInferenceModel,
output_id: usize,
fact: *mut *mut TractInferenceFact,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, fact);
*fact = std::ptr::null_mut();
let f = (*model).0.output_fact(output_id)?;
*fact = Box::into_raw(Box::new(TractInferenceFact(f)));
Ok(())
})
}
/// Set an output fact of an InferenceModel.
///
/// The `fact` argument is only borrowed by this function, it still must be destroyed.
/// `fact` can be set to NULL to erase the current output fact of the model.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_set_output_fact(
model: *mut TractInferenceModel,
output_id: usize,
fact: *const TractInferenceFact,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model);
let f = fact.as_ref().map(|f| &f.0).cloned().unwrap_or_default();
(*model).0.set_output_fact(output_id, f)?;
Ok(())
})
}
/// Analyse an InferencedModel in-place.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_analyse(
model: *mut TractInferenceModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model);
(*model).0.analyse()?;
Ok(())
})
}
/// Transform a fully analysed InferenceModel to a TypedModel.
///
/// This function takes ownership of the InferenceModel `model` whether it succeeds
/// or not. `tract_inference_model_destroy` must not be used on `model`.
///
/// On the other hand, caller will be owning the newly created typed model.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_into_model(
model: *mut *mut TractInferenceModel,
typed: *mut *mut TractModel,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, *model, typed);
*typed = std::ptr::null_mut();
let m = Box::from_raw(*model);
*model = std::ptr::null_mut();
let result = m.0.into_model()?;
*typed = Box::into_raw(Box::new(TractModel(result))) as _;
Ok(())
})
}
/// Destroy an InferenceModel.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_inference_model_destroy(
model: *mut *mut TractInferenceModel,
) -> TRACT_RESULT {
release!(model)
}
// TYPED MODEL
pub struct TractModel(tract_rs::Model);
/// Query an InferenceModel input counts.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_input_count(
model: *const TractModel,
inputs: *mut usize,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, inputs);
let model = &(*model).0;
*inputs = model.input_count()?;
Ok(())
})
}
/// Query an InferenceModel output counts.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_output_count(
model: *const TractModel,
outputs: *mut usize,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, outputs);
let model = &(*model).0;
*outputs = model.output_count()?;
Ok(())
})
}
/// Query the name of a model input.
///
/// The returned name must be freed by the caller using tract_free_cstring.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_input_name(
model: *const TractModel,
input: usize,
name: *mut *mut c_char,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, name);
*name = std::ptr::null_mut();
let m = &(*model).0;
*name = CString::new(m.input_name(input)?)?.into_raw();
Ok(())
})
}
/// Query the input fact of a model.
///
/// Thre returned fact must be freed with tract_fact_destroy.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_input_fact(
model: *const TractModel,
input_id: usize,
fact: *mut *mut TractFact,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, fact);
*fact = std::ptr::null_mut();
let f = (*model).0.input_fact(input_id)?;
*fact = Box::into_raw(Box::new(TractFact(f)));
Ok(())
})
}
/// Query the name of a model output.
///
/// The returned name must be freed by the caller using tract_free_cstring.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_output_name(
model: *const TractModel,
output: usize,
name: *mut *mut c_char,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, name);
*name = std::ptr::null_mut();
let m = &(*model).0;
*name = CString::new(m.output_name(output)?)?.into_raw();
Ok(())
})
}
/// Query the output fact of a model.
///
/// Thre returned fact must be freed with tract_fact_destroy.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_output_fact(
model: *const TractModel,
input_id: usize,
fact: *mut *mut TractFact,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, fact);
*fact = std::ptr::null_mut();
let f = (*model).0.output_fact(input_id)?;
*fact = Box::into_raw(Box::new(TractFact(f)));
Ok(())
})
}
/// Apply a transform to the model.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_transform(
model: *mut TractModel,
transform: *const i8,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, transform);
let t = CStr::from_ptr(transform as _)
.to_str()
.context("failed to parse transform name (not utf8)")?;
(*model).0.transform(t)
})
}
/// Perform a profile of the model using the provided inputs.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_runnable_profile_json(
model: *mut TractRunnable,
inputs: *mut *mut TractTensor,
json: *mut *mut i8,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, json);
let input: Option<Vec<Tensor>> = if !inputs.is_null() {
let input_len = (*model).0.input_count()?;
Some(
std::slice::from_raw_parts(inputs, input_len)
.iter()
.map(|tv| (**tv).0.clone())
.collect(),
)
} else {
None
};
let profile = (*model).0.profile_json(input)?;
*json = CString::new(profile)?.into_raw() as _;
Ok(())
})
}
/// Convert a TypedModel into a TypedRunnableModel.
///
/// This function transfers ownership of the `model` argument to the newly-created `runnable` model.
///
/// Runnable are reference counted. When done, it should be released with `tract_runnable_release`.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_into_runnable(
model: *mut *mut TractModel,
runnable: *mut *mut TractRunnable,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, runnable);
let m = Box::from_raw(*model).0;
*model = std::ptr::null_mut();
*runnable = Box::into_raw(Box::new(TractRunnable(m.into_runnable()?))) as _;
Ok(())
})
}
/// Query the number of properties in a model.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_property_count(
model: *const TractModel,
count: *mut usize,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, count);
*count = (*model).0.property_keys()?.len();
Ok(())
})
}
/// Query the properties names of a model.
///
/// The "names" array should be big enough to fit `tract_model_property_count` string pointers.
///
/// Each name will have to be freed using `tract_free_cstring`.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_property_names(
model: *const TractModel,
names: *mut *mut i8,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, names);
for (ix, name) in (*model).0.property_keys()?.iter().enumerate() {
*names.add(ix) = CString::new(&**name)?.into_raw() as _;
}
Ok(())
})
}
/// Query a property tensor in a model.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_property(
model: *const TractModel,
name: *const i8,
tensor: *mut *mut TractTensor,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, name, tensor);
let name = CStr::from_ptr(name as _)
.to_str()
.context("failed to parse property name (not utf8)")?
.to_owned();
let v = (*model).0.property(name).context("Property not found")?;
*tensor = Box::into_raw(Box::new(TractTensor(v)));
Ok(())
})
}
/// Parse a fact specification string into an Fact.
///
/// The returned fact must be free with `tract_fact_destroy`.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_model_parse_fact(
model: *mut TractModel,
spec: *const c_char,
fact: *mut *mut TractFact,
) -> TRACT_RESULT {
wrap(|| unsafe {
check_not_null!(model, spec, fact);
let spec = CStr::from_ptr(spec).to_str()?;
let f: tract_rs::Fact = spec.as_fact(&(*model).0)?.as_ref().clone();
*fact = Box::into_raw(Box::new(TractFact(f)));
Ok(())
}
gitextract_37zz2va9/ ├── .all_crates.sh ├── .change_crate_dep.sh ├── .clang-format ├── .github/ │ ├── dependabot.yml │ └── workflows/ │ ├── asan.yml │ ├── binaries.yml │ ├── cost_model.yml │ ├── crates.yml │ ├── cross-platform.yml │ ├── examples.yml │ ├── full.yml │ ├── large_models.yml │ ├── pydoc.yml │ ├── release.yml │ ├── tract-ci-bench.yml │ ├── wheels.yml │ └── windows.yml ├── .gitignore ├── .travis/ │ ├── README.md │ ├── android-ndk.sh │ ├── asan.sh │ ├── bundle-entrypoint.sh │ ├── cache_file.sh │ ├── cargo-deny-check.sh │ ├── ci-system-setup.sh │ ├── cli-tests.sh │ ├── cost_model_task_build.sh │ ├── cross.sh │ ├── debug-tests.sh │ ├── docker-debian-stretch/ │ │ ├── Dockerfile │ │ └── sources.list │ ├── examples.sh │ ├── llm-expectations-541 │ ├── make_bundle.sh │ ├── minion.sh │ ├── minionrc │ ├── native.sh │ ├── onnx-tests.sh │ ├── regular-tests.sh │ ├── run-bundle.sh │ ├── run_all.sh │ ├── setup-sccache.sh │ ├── test-harness.sh │ ├── test-llm.sh │ ├── test-published-crates.sh │ ├── test-rt.sh │ ├── tf.sh │ ├── tflite/ │ │ ├── Dockerfile.tensorflow-aarch64 │ │ ├── Dockerfile.tensorflow-official-rpi │ │ ├── Dockerfile.tensorflow-rpitools │ │ ├── build_tflite_aarch64.sh │ │ ├── build_tflite_raspbian.sh │ │ ├── convert_all.sh │ │ ├── linux_makefile.inc │ │ └── run_all.sh │ ├── tflite.sh │ └── travis.sh ├── .travis.yml ├── .vim/ │ └── coc-settings.json ├── CHANGELOG.md ├── Cargo.toml ├── LICENSE ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── api/ │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── c/ │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── grace_hopper_3_224_224.f32.raw │ │ └── mobilenet.c │ ├── ffi/ │ │ ├── Cargo.toml │ │ ├── cbindgen.toml │ │ └── src/ │ │ └── lib.rs │ ├── generate-tract-h.sh │ ├── proxy/ │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── LICENSE-APACHE │ │ ├── LICENSE-MIT │ │ ├── ci.sh │ │ ├── src/ │ │ │ └── lib.rs │ │ ├── sys/ │ │ │ ├── Cargo.toml │ │ │ ├── build.rs │ │ │ ├── src/ │ │ │ │ └── lib.rs │ │ │ └── tract.h │ │ └── tests/ │ │ └── mobilenet.rs │ ├── py/ │ │ ├── .gitignore │ │ ├── MANIFEST.in │ │ ├── _static/ │ │ │ ├── redirect-index.html │ │ │ └── version-switcher.js │ │ ├── conf.py │ │ ├── docs/ │ │ │ ├── fact.md │ │ │ ├── index.md │ │ │ ├── inference_model.md │ │ │ ├── model.md │ │ │ ├── nnef.md │ │ │ ├── onnx.md │ │ │ ├── runnable.md │ │ │ └── tensor.md │ │ ├── grace_hopper_1x3x224x244.npy │ │ ├── pyproject.toml │ │ ├── requirements-docs.txt │ │ ├── requirements.txt │ │ ├── setup.py │ │ ├── tests/ │ │ │ └── mobilenet_onnx_test.py │ │ └── tract/ │ │ ├── __init__.py │ │ ├── bindings.py │ │ ├── dim.py │ │ ├── fact.py │ │ ├── inference_model.py │ │ ├── model.py │ │ ├── nnef.py │ │ ├── onnx.py │ │ ├── runnable.py │ │ ├── runtime.py │ │ ├── state.py │ │ ├── tensor.py │ │ └── transform.py │ ├── rs/ │ │ ├── Cargo.toml │ │ ├── LICENSE │ │ ├── LICENSE-APACHE │ │ ├── LICENSE-MIT │ │ ├── src/ │ │ │ └── lib.rs │ │ └── tests/ │ │ └── mobilenet.rs │ ├── src/ │ │ ├── lib.rs │ │ ├── macros.rs │ │ └── transform.rs │ └── tests/ │ ├── grace_hopper_3_224_224.f32.raw │ └── mobilenet/ │ └── mod.rs ├── ci/ │ └── tract-ci-minion/ │ ├── .gitignore │ ├── Cargo.toml │ ├── minion.toml.example │ └── src/ │ └── main.rs ├── cli/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src/ │ ├── bench.rs │ ├── compare.rs │ ├── cost.rs │ ├── dump.rs │ ├── hwbench.rs │ ├── llm.rs │ ├── macros.rs │ ├── main.rs │ ├── memory_arena.rs │ ├── model.rs │ ├── params.rs │ ├── plan_options.rs │ ├── run.rs │ ├── runtimes.rs │ ├── tensor.rs │ └── utils.rs ├── core/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── src/ │ │ ├── axes/ │ │ │ ├── mapping.rs │ │ │ ├── mod.rs │ │ │ └── model.rs │ │ ├── broadcast.rs │ │ ├── floats.rs │ │ ├── framework.rs │ │ ├── late_bind.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── model/ │ │ │ ├── fact.rs │ │ │ ├── graph.rs │ │ │ ├── helpers.rs │ │ │ ├── memory.rs │ │ │ ├── mod.rs │ │ │ ├── node.rs │ │ │ ├── order.rs │ │ │ ├── patch.rs │ │ │ ├── rewriter.rs │ │ │ ├── translator.rs │ │ │ └── typed.rs │ │ ├── ops/ │ │ │ ├── array/ │ │ │ │ ├── broadcast.rs │ │ │ │ ├── concat.rs │ │ │ │ ├── dyn_slice.rs │ │ │ │ ├── gather.rs │ │ │ │ ├── gather_elements.rs │ │ │ │ ├── gather_nd.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── one_hot.rs │ │ │ │ ├── pad.rs │ │ │ │ ├── range.rs │ │ │ │ ├── reshape.rs │ │ │ │ ├── scatter_elements.rs │ │ │ │ ├── scatter_nd.rs │ │ │ │ ├── slice.rs │ │ │ │ ├── strided_slice.rs │ │ │ │ ├── tile.rs │ │ │ │ ├── topk.rs │ │ │ │ └── trilu.rs │ │ │ ├── binary.rs │ │ │ ├── cast.rs │ │ │ ├── change_axes.rs │ │ │ ├── cnn/ │ │ │ │ ├── conv/ │ │ │ │ │ ├── block_quant.rs │ │ │ │ │ ├── conv.rs │ │ │ │ │ ├── depth_wise.rs │ │ │ │ │ ├── im2col.rs │ │ │ │ │ ├── lazy_im2col.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── q_sum_b.rs │ │ │ │ ├── deconv/ │ │ │ │ │ ├── deconv.rs │ │ │ │ │ ├── deconv_sum.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── maxpool.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── padding.rs │ │ │ │ ├── patch_axis.rs │ │ │ │ ├── patches.rs │ │ │ │ ├── pools.rs │ │ │ │ └── sumpool.rs │ │ │ ├── downsample/ │ │ │ │ ├── array.rs │ │ │ │ ├── conv.rs │ │ │ │ ├── mod.rs │ │ │ │ └── scan.rs │ │ │ ├── dummy.rs │ │ │ ├── einsum/ │ │ │ │ ├── as_blas.rs │ │ │ │ ├── einsum_matmul.rs │ │ │ │ ├── eval.rs │ │ │ │ ├── kernel_selection.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── prefix_matmul.rs │ │ │ │ └── proptest.rs │ │ │ ├── element_wise.rs │ │ │ ├── fft.rs │ │ │ ├── identity.rs │ │ │ ├── konst.rs │ │ │ ├── logic/ │ │ │ │ ├── comparison.rs │ │ │ │ └── ite.rs │ │ │ ├── logic.rs │ │ │ ├── macros.rs │ │ │ ├── math/ │ │ │ │ ├── complex.rs │ │ │ │ └── mod.rs │ │ │ ├── matmul/ │ │ │ │ ├── de_block_quant.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── optimized.rs │ │ │ │ ├── pack.rs │ │ │ │ └── quant.rs │ │ │ ├── memory/ │ │ │ │ ├── force_eval.rs │ │ │ │ ├── load.rs │ │ │ │ ├── mod.rs │ │ │ │ └── store.rs │ │ │ ├── mod.rs │ │ │ ├── nn/ │ │ │ │ ├── data_formats.rs │ │ │ │ ├── gelu_approximate.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── reduce.rs │ │ │ │ ├── rms_norm.rs │ │ │ │ ├── silu.rs │ │ │ │ └── softmax/ │ │ │ │ ├── fixedpoint.rs │ │ │ │ ├── math.rs │ │ │ │ └── mod.rs │ │ │ ├── quant.rs │ │ │ ├── scan/ │ │ │ │ ├── decluttered.rs │ │ │ │ ├── mod.rs │ │ │ │ └── optimized.rs │ │ │ ├── source.rs │ │ │ ├── submodel.rs │ │ │ └── unimpl.rs │ │ ├── optim/ │ │ │ ├── change_axes.rs │ │ │ ├── concat_then_einsum.rs │ │ │ ├── mod.rs │ │ │ ├── op_optim.rs │ │ │ ├── prop_const.rs │ │ │ ├── propagate_roi.rs │ │ │ ├── push_split_down.rs │ │ │ ├── slice.rs │ │ │ └── uniform_mask.rs │ │ ├── plan.rs │ │ ├── runtime.rs │ │ ├── transform.rs │ │ └── value.rs │ └── test_data/ │ └── test_data.cfg ├── cuda/ │ ├── Cargo.toml │ ├── benches/ │ │ └── cuda_flash.rs │ └── src/ │ ├── context.rs │ ├── kernels/ │ │ ├── array/ │ │ │ ├── cast.rs │ │ │ ├── copy.rs │ │ │ ├── dispatch.rs │ │ │ ├── mod.rs │ │ │ └── rotate_half.rs │ │ ├── binary.rs │ │ ├── conv.rs │ │ ├── conv_cudnn.rs │ │ ├── cu/ │ │ │ ├── array.cu │ │ │ ├── binary.cu │ │ │ ├── cnn.cu │ │ │ ├── common.cuh │ │ │ ├── element_wise.cu │ │ │ ├── flash_attn.cu │ │ │ ├── ggml_flash_attn.cu │ │ │ ├── mm_mv.cu │ │ │ ├── mm_mv_q.cu │ │ │ ├── nn.cu │ │ │ └── quantize.cu │ │ ├── element_wise.rs │ │ ├── flash_attn.rs │ │ ├── ggml_flash_attn.rs │ │ ├── iff.rs │ │ ├── launch_args.rs │ │ ├── matmul/ │ │ │ ├── mod.rs │ │ │ └── quant_act_q81.rs │ │ ├── mod.rs │ │ ├── nn/ │ │ │ ├── apply_rope.rs │ │ │ ├── gelu_approximate.rs │ │ │ ├── leaky_relu.rs │ │ │ ├── mod.rs │ │ │ ├── reduce.rs │ │ │ ├── rms_norm.rs │ │ │ ├── scaled_masked_softmax.rs │ │ │ └── softmax.rs │ │ └── utils.rs │ ├── lib.rs │ ├── ops/ │ │ ├── conv.rs │ │ ├── flash_attn.rs │ │ ├── fused_axis_op.rs │ │ ├── gemm.rs │ │ ├── ggml_flash_attn.rs │ │ ├── iff.rs │ │ ├── mod.rs │ │ └── quant_q81.rs │ ├── rewrite_rules/ │ │ ├── add_matmul_broadcast.rs │ │ ├── fuse_axis_op.rs │ │ ├── mod.rs │ │ ├── pad_q40_weights.rs │ │ └── untranspose_matmul_output.rs │ ├── tensor.rs │ ├── transform.rs │ └── utils.rs ├── data/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── benches/ │ │ ├── stack_tensors.rs │ │ └── tensor_from_datum.rs │ └── src/ │ ├── blob.rs │ ├── datum.rs │ ├── dim/ │ │ ├── assertion.rs │ │ ├── mod.rs │ │ ├── parse.rs │ │ ├── resolve.rs │ │ ├── sym.rs │ │ └── tree.rs │ ├── exotic.rs │ ├── lib.rs │ ├── macros.rs │ ├── scatter.rs │ ├── tensor/ │ │ ├── litteral.rs │ │ ├── plain_view.rs │ │ ├── storage.rs │ │ └── view.rs │ └── tensor.rs ├── deny.toml ├── doc/ │ ├── README.md │ ├── cli-recipe.md │ ├── graph.md │ ├── intro.md │ ├── kernel-notes.md │ ├── nnef/ │ │ ├── tract-core.nnef │ │ ├── tract-onnx.nnef │ │ ├── tract-pulse.nnef │ │ └── tract-resource.nnef │ └── op.md ├── examples/ │ ├── .gitignore │ ├── causal_llm/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ ├── scripts/ │ │ │ └── generate_ci_llm_assets.sh │ │ └── src/ │ │ ├── bin/ │ │ │ ├── client.rs │ │ │ ├── common/ │ │ │ │ └── mod.rs │ │ │ ├── complete.rs │ │ │ └── serve.rs │ │ └── lib.rs │ ├── face_detection_yolov8onnx_example/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ └── src/ │ │ └── main.rs │ ├── face_similarity_arcface_onnx/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ └── src/ │ │ ├── arc_face.rs │ │ ├── main.rs │ │ └── yolo_face.rs │ ├── keras-tract-tf2/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh.nope │ │ ├── example.py │ │ ├── io.npz │ │ ├── requirements.txt │ │ └── src/ │ │ └── main.rs │ ├── nemo-nemotron-asr/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── ci.sh │ │ ├── nemotron.py │ │ └── src/ │ │ └── main.rs │ ├── nemo-parakeet-asr/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── ci.sh │ │ ├── parakeet.py │ │ └── src/ │ │ └── main.rs │ ├── nnef-dump-mobilenet-v2/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ └── src/ │ │ └── main.rs │ ├── nnef-mobilenet-v2/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── ci.sh │ │ ├── imagenet_slim_labels.txt │ │ └── src/ │ │ └── main.rs │ ├── nnef-mobilenet-v2-api/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── ci.sh │ │ ├── imagenet_slim_labels.txt │ │ └── src/ │ │ └── main.rs │ ├── onnx-mobilenet-v2/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ ├── imagenet_slim_labels.txt │ │ └── src/ │ │ ├── bin/ │ │ │ └── dyn-shape.rs │ │ └── main.rs │ ├── pytorch-albert-v2/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ ├── export.py │ │ └── src/ │ │ └── main.rs │ ├── pytorch-resnet/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ ├── export.py │ │ ├── requirements.txt │ │ └── src/ │ │ └── main.rs │ ├── stable-diffusion/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci-gpu.sh │ │ ├── export.py │ │ ├── reference.py │ │ └── src/ │ │ └── main.rs │ ├── stable-diffusion-3/ │ │ ├── Cargo.toml │ │ ├── export.py │ │ ├── reference.py │ │ ├── runme.sh │ │ └── src/ │ │ └── main.rs │ ├── stable-diffusion-xl/ │ │ ├── Cargo.toml │ │ ├── ci-gpu.sh │ │ ├── export.py │ │ ├── reference.py │ │ └── src/ │ │ └── main.rs │ ├── tensorflow-mobilenet-v2/ │ │ ├── .gitignore │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── ci.sh │ │ ├── imagenet_slim_labels.txt │ │ └── src/ │ │ └── main.rs │ └── tflite-mobilenet-v3/ │ ├── .gitignore │ ├── Cargo.toml │ ├── README.md │ ├── ci.sh │ ├── imagenet_slim_labels.txt │ └── src/ │ └── main.rs ├── extra/ │ ├── Cargo.toml │ └── src/ │ ├── exp_unit_norm.rs │ └── lib.rs ├── gpu/ │ ├── Cargo.toml │ └── src/ │ ├── device.rs │ ├── fact.rs │ ├── lib.rs │ ├── memory/ │ │ ├── mod.rs │ │ ├── pool.rs │ │ └── schema.rs │ ├── ops/ │ │ ├── RECIPE.md │ │ ├── apply_rope.rs │ │ ├── binary.rs │ │ ├── broadcast.rs │ │ ├── cast.rs │ │ ├── change_axes.rs │ │ ├── concat.rs │ │ ├── copy_based.rs │ │ ├── dyn_kv_cache.rs │ │ ├── element_wise.rs │ │ ├── gelu_approximate.rs │ │ ├── iff.rs │ │ ├── leaky_relu.rs │ │ ├── mod.rs │ │ ├── pulse.rs │ │ ├── reduce.rs │ │ ├── rms_norm.rs │ │ ├── rotate_half.rs │ │ ├── scaled_masked_softmax.rs │ │ ├── slice.rs │ │ └── softmax.rs │ ├── rewrite_rules/ │ │ ├── mod.rs │ │ ├── rewire_sdpa.rs │ │ ├── rewire_syncs.rs │ │ └── rms_norm.rs │ ├── session_handler.rs │ ├── sync.rs │ ├── tensor/ │ │ ├── arena_view.rs │ │ ├── mod.rs │ │ └── owned.rs │ └── utils.rs ├── harness/ │ ├── core-proptest-pulse/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── conv_plus_conv.rs │ │ ├── deconv.rs │ │ ├── delay_plus_downsample.rs │ │ ├── delay_plus_pool.rs │ │ ├── einsum.rs │ │ ├── lib.rs │ │ └── pad_plus_conv.rs │ ├── nemotron-speech-streaming-en-0.6b/ │ │ └── ci.sh │ ├── nnef-inceptionv3/ │ │ ├── Cargo.toml │ │ ├── download.sh │ │ └── src/ │ │ └── lib.rs │ ├── nnef-test-cases/ │ │ ├── .gitignore │ │ ├── conv-bias/ │ │ │ ├── expected │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── conv-q40/ │ │ │ ├── conv2d/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_base_kernel1/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_base_kernel3/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_base_kernel9/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_dilation2/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_dilation4/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_dilation8/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_groups2/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_groups4/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_insize128/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_insize64/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── conv_stride2/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ └── conv_stride3/ │ │ │ ├── io.npz │ │ │ ├── model.nnef.tgz │ │ │ └── runme.sh │ │ ├── conv-with-batch/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── debox/ │ │ │ ├── debox_base/ │ │ │ │ ├── graph.nnef │ │ │ │ ├── io.npz │ │ │ │ └── runme.sh │ │ │ └── debox_high_dim/ │ │ │ ├── graph.nnef │ │ │ ├── io.npz │ │ │ └── runme.sh │ │ ├── dyn_slice/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── fixed_roll/ │ │ │ ├── graph.nnef │ │ │ ├── io.npz │ │ │ └── runme.sh │ │ ├── memory-arena/ │ │ │ ├── expected.json │ │ │ └── runme.sh │ │ ├── pool-padding/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── q40_linear_followed_slice/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── qmul/ │ │ │ ├── graph.nnef │ │ │ ├── graph.quant │ │ │ ├── io.npz │ │ │ └── runme.sh │ │ ├── range-slice-dyn-tile/ │ │ │ ├── model.nnef.tgz │ │ │ └── runme.sh │ │ ├── reshape/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── reshape_with_bc/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── sdpa/ │ │ │ ├── simple-causal-f32/ │ │ │ │ ├── graph.nnef │ │ │ │ ├── io.npz │ │ │ │ └── runme.sh │ │ │ ├── simple-f16/ │ │ │ │ ├── graph.nnef │ │ │ │ ├── io.npz │ │ │ │ └── runme.sh │ │ │ ├── simple-grouped-query-att-f32/ │ │ │ │ ├── io.npz │ │ │ │ ├── model.nnef.tgz │ │ │ │ └── runme.sh │ │ │ ├── simple-mask-f32/ │ │ │ │ ├── graph.nnef │ │ │ │ ├── io.npz │ │ │ │ └── runme.sh │ │ │ ├── simple-non-causal-f32/ │ │ │ │ ├── graph.nnef │ │ │ │ ├── io.npz │ │ │ │ └── runme.sh │ │ │ └── simple-scale-f32/ │ │ │ ├── graph.nnef │ │ │ ├── io.npz │ │ │ └── runme.sh │ │ ├── slice-over-slice-optim-loop/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── softmax/ │ │ │ ├── softmax-change-axis/ │ │ │ │ ├── expected │ │ │ │ ├── graph.nnef │ │ │ │ └── runme.sh │ │ │ ├── softmax-change-axis-1/ │ │ │ │ ├── expected │ │ │ │ ├── graph.nnef │ │ │ │ └── runme.sh │ │ │ └── softmax-quant/ │ │ │ ├── expected/ │ │ │ │ ├── graph.nnef │ │ │ │ └── graph.quant │ │ │ ├── model/ │ │ │ │ ├── graph.nnef │ │ │ │ └── graph.quant │ │ │ └── runme.sh │ │ ├── submodel/ │ │ │ ├── expected │ │ │ ├── graph.nnef │ │ │ ├── graph.quant │ │ │ ├── nnet2/ │ │ │ │ ├── graph.nnef │ │ │ │ └── graph.quant │ │ │ └── runme.sh │ │ ├── tdim-cmp/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── test_all_reduce/ │ │ │ ├── io.npz │ │ │ ├── model.nnef.tgz │ │ │ └── runme.sh │ │ ├── test_any_reduce/ │ │ │ ├── io.npz │ │ │ ├── model.nnef.tgz │ │ │ └── runme.sh │ │ ├── test_manage_gru_states/ │ │ │ ├── io.npz │ │ │ ├── model.nnef.tgz │ │ │ └── runme.sh │ │ ├── test_stft_smaller_win/ │ │ │ ├── io.npz │ │ │ ├── model.nnef.tgz │ │ │ └── runme.sh │ │ ├── test_upcast_f32_attn/ │ │ │ ├── io.npz │ │ │ ├── model.nnef.tgz │ │ │ └── runme.sh │ │ ├── tile-with-tdim/ │ │ │ ├── graph.nnef │ │ │ └── runme.sh │ │ ├── uniform-mul/ │ │ │ ├── expected │ │ │ ├── graph.nnef │ │ │ ├── io.npz │ │ │ └── runme.sh │ │ └── variable-in-fragment/ │ │ ├── graph.nnef │ │ └── runme.sh │ ├── parakeet-tdt-600m-v3/ │ │ └── ci.sh │ ├── pre-optimized-graphes/ │ │ ├── .gitignore │ │ ├── hey_snips_v4_model17/ │ │ │ ├── expected │ │ │ └── runme.sh │ │ └── mdl-en-2019-Q3-librispeech/ │ │ ├── expected │ │ └── runme.sh │ ├── tf-inceptionv3/ │ │ ├── Cargo.toml │ │ ├── benches/ │ │ │ └── inceptionv3.rs │ │ ├── download.sh │ │ └── src/ │ │ └── lib.rs │ ├── tf-mobilenet-v2/ │ │ ├── Cargo.toml │ │ ├── download.sh │ │ └── src/ │ │ └── lib.rs │ └── tfl-mobilenet-v2-q/ │ ├── Cargo.toml │ ├── download.sh │ └── src/ │ └── lib.rs ├── hir/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src/ │ ├── framework.rs │ ├── infer/ │ │ ├── analyser.rs │ │ ├── fact.rs │ │ ├── factoid.rs │ │ ├── helpers.rs │ │ ├── mod.rs │ │ ├── model.rs │ │ ├── ops.rs │ │ ├── optim.rs │ │ └── rules/ │ │ ├── cache.rs │ │ ├── expr.rs │ │ ├── mod.rs │ │ ├── path.rs │ │ ├── proxies.rs │ │ └── solver.rs │ ├── lib.rs │ ├── macros.rs │ └── ops/ │ ├── activations.rs │ ├── array/ │ │ ├── add_dims.rs │ │ ├── array_feature_extractor.rs │ │ ├── broadcast.rs │ │ ├── concat.rs │ │ ├── constant_like.rs │ │ ├── constant_of_shape.rs │ │ ├── crop.rs │ │ ├── dyn_slice.rs │ │ ├── flatten.rs │ │ ├── gather.rs │ │ ├── gather_elements.rs │ │ ├── gather_nd.rs │ │ ├── mod.rs │ │ ├── pad.rs │ │ ├── permute_axes.rs │ │ ├── range.rs │ │ ├── reshape.rs │ │ ├── rm_dims.rs │ │ ├── scatter_elements.rs │ │ ├── scatter_nd.rs │ │ ├── shape.rs │ │ ├── size.rs │ │ ├── slice.rs │ │ ├── split.rs │ │ ├── squeeze.rs │ │ ├── strided_slice.rs │ │ └── tile.rs │ ├── binary.rs │ ├── cast.rs │ ├── cnn/ │ │ ├── conv.rs │ │ ├── mod.rs │ │ └── pools.rs │ ├── downsample.rs │ ├── dummy.rs │ ├── element_wise.rs │ ├── expandable.rs │ ├── identity.rs │ ├── konst.rs │ ├── logic.rs │ ├── matmul.rs │ ├── mod.rs │ ├── nn/ │ │ ├── global_pools.rs │ │ ├── layer_max.rs │ │ ├── mod.rs │ │ ├── reduce.rs │ │ └── softmax.rs │ ├── quant.rs │ ├── scan.rs │ ├── source.rs │ └── unimpl.rs ├── libcli/ │ ├── Cargo.toml │ ├── src/ │ │ ├── annotations.rs │ │ ├── display_params.rs │ │ ├── draw.rs │ │ ├── export.rs │ │ ├── lib.rs │ │ ├── model.rs │ │ ├── profile.rs │ │ ├── tensor.rs │ │ ├── terminal.rs │ │ └── time.rs │ └── validate_wires.py ├── linalg/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── arm32/ │ │ ├── armv7neon/ │ │ │ ├── armv7neon_mmm_f32_32x1_core.tmpl │ │ │ ├── armv7neon_mmm_f32_8x1_core.tmpl │ │ │ ├── armv7neon_mmm_f32_8x4_core.tmpl │ │ │ ├── armv7neon_mmm_f32_8x6_core.tmpl │ │ │ ├── armv7neon_mmm_f32_per_cols.tmpliq │ │ │ ├── armv7neon_mmm_f32_per_rows.tmpliq │ │ │ ├── armv7neon_mmm_f32_scalars.tmpliq │ │ │ ├── armv7neon_mmm_i32_32x1.tmpl │ │ │ ├── armv7neon_mmm_i32_8x4.tmpl │ │ │ ├── armv7neon_mmm_i32_per_cols.tmpliq │ │ │ ├── armv7neon_mmm_i32_per_rows.tmpliq │ │ │ ├── armv7neon_mmm_i32_scalars.tmpliq │ │ │ ├── armv7neon_mmm_i32_scale_q8_q15.tmpliq │ │ │ ├── armv7neon_mmm_q_per_col.tmpliq │ │ │ ├── armv7neon_mmm_q_per_row.tmpliq │ │ │ ├── armv7neon_mmm_q_scalar.tmpliq │ │ │ ├── armv7neon_prefetch.tmpl │ │ │ ├── armv7neon_sigmoid_f32_4n.tmpl │ │ │ ├── armv7neon_tanh_f32_4n.tmpl │ │ │ └── dispatcher.tmpliq │ │ └── armvfpv2/ │ │ ├── armvfpv2_mmm_f32_4x4.tmpl │ │ └── dispatcher.tmpliq │ ├── arm64/ │ │ ├── apple_amx/ │ │ │ ├── apple_amx_mmm_f16_64x1.tmpl │ │ │ ├── apple_amx_mmm_f16_64x32.tmpl │ │ │ ├── apple_amx_mmm_f32_32x1.tmpl │ │ │ ├── apple_amx_mmm_f32_32x32.tmpl │ │ │ ├── dispatcher.tmpliq │ │ │ └── instructions.rs │ │ ├── arm64fp16/ │ │ │ ├── arm64fp16_leaky_relu_f16_8n.tmpl │ │ │ ├── arm64fp16_mmm_8h_per_col.tmpliq │ │ │ ├── arm64fp16_mmm_8h_per_row.tmpliq │ │ │ ├── arm64fp16_mmm_8h_scalar.tmpliq │ │ │ ├── arm64fp16_mmm_f16_128x1/ │ │ │ │ ├── loop1/ │ │ │ │ │ ├── cortex_a53.tmpli │ │ │ │ │ └── naive.tmpli │ │ │ │ └── loop2/ │ │ │ │ └── cortex_a55.tmpli │ │ │ ├── arm64fp16_mmm_f16_128x1_core.tmpl │ │ │ ├── arm64fp16_mmm_f16_16x8/ │ │ │ │ ├── loop1/ │ │ │ │ │ └── naive.tmpli │ │ │ │ └── loop2/ │ │ │ │ └── cortex_a55.tmpli │ │ │ ├── arm64fp16_mmm_f16_16x8_core.tmpl │ │ │ ├── arm64fp16_mmm_f16_32x4/ │ │ │ │ ├── loop1/ │ │ │ │ │ └── naive.tmpli │ │ │ │ └── loop2/ │ │ │ │ └── cortex_a55.tmpli │ │ │ ├── arm64fp16_mmm_f16_32x4_core.tmpl │ │ │ ├── arm64fp16_mmm_f16_32x6.core.tmpl │ │ │ ├── arm64fp16_mmm_f16_64x1.core.tmpl │ │ │ ├── arm64fp16_mmm_f16_64x3.core.tmpl │ │ │ ├── arm64fp16_mmm_f16_per_cols.tmpliq │ │ │ ├── arm64fp16_mmm_f16_per_rows.tmpliq │ │ │ ├── arm64fp16_mmm_f16_scalars.tmpliq │ │ │ ├── arm64fp16_mmm_load_tile.tmpliq │ │ │ ├── arm64fp16_sigmoid_f16_8n.tmpl │ │ │ ├── arm64fp16_tanh_f16_8n.tmpl │ │ │ ├── dispatcher.tmpliq │ │ │ ├── dummy_fmla_no_pragma.S │ │ │ └── dummy_fmla_pragma.S │ │ └── arm64simd/ │ │ ├── arm64simd_mmm_4s_per_col.tmpliq │ │ ├── arm64simd_mmm_4s_per_row.tmpliq │ │ ├── arm64simd_mmm_4s_scalar.tmpliq │ │ ├── arm64simd_mmm_f32_12x8/ │ │ │ ├── packed_packed_loop1/ │ │ │ │ ├── ldr_w_no_preload.tmpli │ │ │ │ ├── ldr_w_preload.tmpli │ │ │ │ ├── ldr_x_preload.tmpli │ │ │ │ └── naive.tmpli │ │ │ └── packed_packed_loop2/ │ │ │ └── cortex_a55.tmpli │ │ ├── arm64simd_mmm_f32_12x8_core.tmpl │ │ ├── arm64simd_mmm_f32_16x4/ │ │ │ ├── packed_packed_loop1/ │ │ │ │ ├── cortex_a53.tmpli │ │ │ │ └── naive.tmpli │ │ │ └── packed_packed_loop2/ │ │ │ └── cortex_a55.tmpli │ │ ├── arm64simd_mmm_f32_16x4_core.tmpl │ │ ├── arm64simd_mmm_f32_24x4/ │ │ │ ├── loop2/ │ │ │ │ └── cortex_a55.tmpli │ │ │ └── packed_packed_loop1/ │ │ │ ├── cortex_a53.tmpli │ │ │ ├── cortex_a55.tmpli │ │ │ └── naive.tmpli │ │ ├── arm64simd_mmm_f32_24x4_core.tmpl │ │ ├── arm64simd_mmm_f32_32x1_core.tmpl │ │ ├── arm64simd_mmm_f32_32x3_core.tmpl │ │ ├── arm64simd_mmm_f32_64x1/ │ │ │ ├── loop1/ │ │ │ │ ├── cortex_a53.tmpli │ │ │ │ └── naive.tmpli │ │ │ └── loop2/ │ │ │ ├── cortex_a55.tmpli │ │ │ └── naive.tmpli │ │ ├── arm64simd_mmm_f32_64x1_core.tmpl │ │ ├── arm64simd_mmm_f32_8x8/ │ │ │ ├── packed_packed_loop1/ │ │ │ │ ├── broken_chains.tmpli │ │ │ │ ├── ldr_w_no_preload.tmpli │ │ │ │ ├── ldr_w_preload.tmpli │ │ │ │ ├── ldr_x_no_preload.tmpli │ │ │ │ ├── ldr_x_preload.tmpli │ │ │ │ └── naive.tmpli │ │ │ └── packed_packed_loop2/ │ │ │ ├── broken_chains.tmpli │ │ │ └── cortex_a55.tmpli │ │ ├── arm64simd_mmm_f32_8x8_core.tmpl │ │ ├── arm64simd_mmm_f32_per_cols.tmpliq │ │ ├── arm64simd_mmm_f32_per_rows.tmpliq │ │ ├── arm64simd_mmm_f32_scalars.tmpliq │ │ ├── arm64simd_mmm_i32_64x1.tmpl │ │ ├── arm64simd_mmm_i32_8x8.tmpl │ │ ├── arm64simd_mmm_i32_per_cols.tmpliq │ │ ├── arm64simd_mmm_i32_per_rows.tmpliq │ │ ├── arm64simd_mmm_i32_scalars.tmpliq │ │ ├── arm64simd_mmm_i32_scale_q16_q31.tmpliq │ │ ├── arm64simd_mmm_load_tile.tmpliq │ │ ├── arm64simd_sigmoid_f32_4n.tmpl │ │ ├── arm64simd_tanh_f32_4n.tmpl │ │ └── dispatcher.tmpliq │ ├── benches/ │ │ ├── arm32neon.rs │ │ ├── arm64.rs │ │ ├── arm64simd.rs │ │ ├── intel.rs │ │ ├── leaky_relu.rs │ │ ├── mat_vec.rs │ │ ├── mm_for_asr_am.rs │ │ ├── mm_for_inception.rs │ │ ├── mm_for_wavenet_hw.rs │ │ ├── sigmoid.rs │ │ ├── softmax.rs │ │ ├── utils.rs │ │ ├── virtual_im2col.rs │ │ └── x86_64.rs │ ├── build.rs │ ├── cost_model/ │ │ ├── Cargo.toml │ │ ├── src/ │ │ │ └── main.rs │ │ └── train/ │ │ ├── README.md │ │ ├── requirements.txt │ │ ├── runme.sh │ │ └── train.py │ ├── matmul-bench/ │ │ ├── Cargo.toml │ │ ├── benches/ │ │ │ └── matmul.rs │ │ ├── build.rs │ │ ├── c/ │ │ │ ├── packed_tile_4x4.c │ │ │ ├── packed_tile_8x8.c │ │ │ ├── tile_1x1.c │ │ │ ├── tile_2x2.c │ │ │ ├── tile_4x4.c │ │ │ └── tile_8x8.c │ │ └── src/ │ │ └── lib.rs │ ├── src/ │ │ ├── arm32/ │ │ │ ├── armv7neon.rs │ │ │ ├── armvfpv2.rs │ │ │ ├── cortex_a7.rs │ │ │ ├── cortex_a7.txt │ │ │ ├── cortex_a9.rs │ │ │ └── cortex_a9.txt │ │ ├── arm32.rs │ │ ├── arm64/ │ │ │ ├── apple_amx.rs │ │ │ ├── arm64fp16/ │ │ │ │ ├── by_scalar.rs │ │ │ │ ├── leaky_relu.rs │ │ │ │ ├── max.rs │ │ │ │ ├── panel_extract.rs │ │ │ │ ├── sum.rs │ │ │ │ └── unicast.rs │ │ │ ├── arm64fp16.rs │ │ │ ├── arm64simd/ │ │ │ │ ├── by_scalar.rs │ │ │ │ ├── leaky_relu.rs │ │ │ │ ├── max.rs │ │ │ │ ├── panel_extract.rs │ │ │ │ ├── softmax.rs │ │ │ │ ├── sum.rs │ │ │ │ └── unicast.rs │ │ │ ├── arm64simd.rs │ │ │ ├── cortex_a53.rs │ │ │ ├── cortex_a55.rs │ │ │ ├── cortex_a72.rs │ │ │ └── cortex_a73.rs │ │ ├── arm64.rs │ │ ├── frame/ │ │ │ ├── block_quant/ │ │ │ │ ├── helpers.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── q4_0.rs │ │ │ │ ├── q8_1.rs │ │ │ │ ├── storage.rs │ │ │ │ └── value.rs │ │ │ ├── by_scalar.rs │ │ │ ├── element_wise.rs │ │ │ ├── element_wise_helper.rs │ │ │ ├── leaky_relu.rs │ │ │ ├── lut.rs │ │ │ ├── mmm/ │ │ │ │ ├── cost_model.rs │ │ │ │ ├── fuse.rs │ │ │ │ ├── input_store.rs │ │ │ │ ├── kernel.rs │ │ │ │ ├── macros.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── panel_extract.rs │ │ │ │ ├── scratch.rs │ │ │ │ ├── storage.rs │ │ │ │ └── tests/ │ │ │ │ ├── frame.rs │ │ │ │ ├── fuse.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── packed_packed.rs │ │ │ │ ├── q_scale.rs │ │ │ │ └── store.rs │ │ │ ├── mod.rs │ │ │ ├── pack.rs │ │ │ ├── reduce/ │ │ │ │ ├── max.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── softmax.rs │ │ │ │ └── sum.rs │ │ │ ├── sigmoid.rs │ │ │ ├── tanh.rs │ │ │ ├── unicast.rs │ │ │ └── weights.rs │ │ ├── generic/ │ │ │ ├── by_scalar.rs │ │ │ ├── erf.rs │ │ │ ├── leaky_relu.rs │ │ │ ├── lut.rs │ │ │ ├── mmm.rs │ │ │ ├── reduce.rs │ │ │ ├── rounding.rs │ │ │ ├── sigmoid.rs │ │ │ ├── tanh.rs │ │ │ └── unicast.rs │ │ ├── generic.rs │ │ ├── hwbench/ │ │ │ ├── bandwidth.rs │ │ │ ├── mod.rs │ │ │ └── runner.rs │ │ ├── lib.rs │ │ ├── multithread.rs │ │ ├── wasm.rs │ │ ├── x86_64_fma/ │ │ │ ├── by_scalar.rs │ │ │ ├── intel.rs │ │ │ ├── max.rs │ │ │ ├── mmm.rs │ │ │ ├── panel_extract.rs │ │ │ └── softmax.rs │ │ └── x86_64_fma.rs │ ├── tests/ │ │ └── virtual_im2col.rs │ └── x86_64/ │ ├── avx512/ │ │ ├── 10x1/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 1x1/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512.tmpli │ │ │ ├── unroll-16.tmpli │ │ │ ├── unroll-4.tmpli │ │ │ ├── unroll-8.tmpli │ │ │ └── unroll.tmpli │ │ ├── 1x12/ │ │ │ └── packed_packed_loop1/ │ │ │ └── avx-512.tmpli │ │ ├── 2x5/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 2x6/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 3x4/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 4x3/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 5x2/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 6x1/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 6x2/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 7x1/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 8x1/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── 8x2/ │ │ │ └── packed_packed_loop1/ │ │ │ └── avx-512.tmpli │ │ ├── 8x8/ │ │ │ └── packed_packed_loop1/ │ │ │ ├── avx-512-unroll.tmpli │ │ │ └── avx-512.tmpli │ │ ├── avx512_mmm_f32_128x1.tmpl │ │ ├── avx512_mmm_f32_16x1.tmpl │ │ ├── avx512_mmm_f32_16x12.tmpl │ │ ├── avx512_mmm_f32_16x8.tmpl │ │ ├── avx512_mmm_f32_32x5.tmpl │ │ ├── avx512_mmm_f32_32x6.tmpl │ │ ├── avx512_mmm_f32_48x4.tmpl │ │ ├── avx512_mmm_f32_64x3.tmpl │ │ ├── avx512_mmm_f32_80x2.tmpl │ │ ├── avx512_mmm_load_tile.tmpliq │ │ ├── dispatcher.tmpliq │ │ ├── f32_per_cols.tmpliq │ │ ├── f32_per_rows.tmpliq │ │ ├── f32_scalars.tmpliq │ │ ├── i32_per_cols.tmpliq │ │ ├── i32_per_rows.tmpliq │ │ ├── i32_scalars.tmpliq │ │ ├── postamble.tmpliq │ │ ├── preamble.tmpliq │ │ ├── sigmoid_f32.tmpl │ │ ├── tanh_f32.tmpl │ │ ├── zmm_per_col.tmpliq │ │ ├── zmm_per_row.tmpliq │ │ └── zmm_scalar.tmpliq │ └── fma/ │ ├── 10x1/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 2x5/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 2x6/ │ │ └── packed_packed_loop1/ │ │ ├── original-unroll.tmpli │ │ └── original.tmpli │ ├── 3x4/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 4x3/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 5x2/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 6x1/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 6x2/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 7x1/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 8x1/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── 8x8/ │ │ └── packed_packed_loop1/ │ │ ├── avx-unroll.tmpli │ │ └── avx.tmpli │ ├── avx2_mmm_i32_8x8.tmpl │ ├── dispatcher.tmpliq │ ├── fma_mmm_f32_16x5.tmpl │ ├── fma_mmm_f32_16x6.tmpl │ ├── fma_mmm_f32_24x4.tmpl │ ├── fma_mmm_f32_32x1.tmpl │ ├── fma_mmm_f32_32x3.tmpl │ ├── fma_mmm_f32_40x2.tmpl │ ├── fma_mmm_f32_64x1.tmpl │ ├── fma_mmm_f32_8x8.tmpl │ ├── fma_mmm_f32_per_cols.tmpliq │ ├── fma_mmm_f32_per_rows.tmpliq │ ├── fma_mmm_f32_scalars.tmpliq │ ├── fma_mmm_i32_per_cols.tmpliq │ ├── fma_mmm_i32_per_rows.tmpliq │ ├── fma_mmm_i32_scalars.tmpliq │ ├── fma_mmm_load_tile.tmpliq │ ├── fma_mmm_ymm_per_col.tmpliq │ ├── fma_mmm_ymm_per_row.tmpliq │ ├── fma_mmm_ymm_scalar.tmpliq │ ├── fma_sigmoid_f32.tmpl │ ├── fma_tanh_f32.tmpl │ ├── postamble.tmpliq │ └── preamble.tmpliq ├── metal/ │ ├── Cargo.toml │ ├── README.md │ ├── benches/ │ │ └── metal_gemm.rs │ └── src/ │ ├── command_buffer.rs │ ├── context.rs │ ├── encoder.rs │ ├── func_constants.rs │ ├── kernels/ │ │ ├── array/ │ │ │ ├── array_ops.metal │ │ │ ├── cast.rs │ │ │ ├── copy.rs │ │ │ ├── dispatch.rs │ │ │ ├── mod.rs │ │ │ └── rotate_half.rs │ │ ├── bin_ops.metal │ │ ├── bin_ops.rs │ │ ├── conv.metal │ │ ├── conv.rs │ │ ├── element_wise.metal │ │ ├── element_wise.rs │ │ ├── matmul/ │ │ │ ├── basic/ │ │ │ │ ├── basic_mat_mul.metal │ │ │ │ └── mod.rs │ │ │ ├── ggml_gemm/ │ │ │ │ ├── README.md │ │ │ │ ├── ggml_mm_mv.metal │ │ │ │ └── mod.rs │ │ │ ├── mfa/ │ │ │ │ ├── libMetalFlashAttention-ios.metallib │ │ │ │ ├── libMetalFlashAttention-macos.metallib │ │ │ │ └── mod.rs │ │ │ ├── mlx_gemm/ │ │ │ │ ├── mlx_gemm.metal │ │ │ │ ├── mlx_gemv.metal │ │ │ │ └── mod.rs │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── nn/ │ │ │ ├── apply_rope.rs │ │ │ ├── gelu_approximate.rs │ │ │ ├── leaky_relu.rs │ │ │ ├── mod.rs │ │ │ ├── nn_ops.metal │ │ │ ├── reduce.rs │ │ │ ├── rms_norm.rs │ │ │ ├── scaled_masked_softmax.rs │ │ │ ├── silu.rs │ │ │ └── softmax.rs │ │ └── utils.rs │ ├── lib.rs │ ├── ops/ │ │ ├── conv.rs │ │ ├── fused_axis_op.rs │ │ ├── gemm.rs │ │ └── mod.rs │ ├── rewrite_rules/ │ │ ├── add_matmul_broadcast.rs │ │ ├── fuse_axis_op.rs │ │ ├── mod.rs │ │ └── untranspose_matmul_output.rs │ ├── tensor.rs │ ├── tests.rs │ ├── transform.rs │ └── utils.rs ├── nnef/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── cli/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── main.rs │ ├── nnef-resources/ │ │ ├── Cargo.toml │ │ ├── src/ │ │ │ ├── json_loader.rs │ │ │ └── lib.rs │ │ └── tests/ │ │ ├── nnef_with_json/ │ │ │ ├── graph.nnef │ │ │ └── src_config.json │ │ └── test_json_resource.rs │ ├── src/ │ │ ├── ast/ │ │ │ ├── dump.rs │ │ │ ├── dump_doc.rs │ │ │ ├── parse.rs │ │ │ └── quant.rs │ │ ├── ast.rs │ │ ├── deser.rs │ │ ├── framework.rs │ │ ├── lib.rs │ │ ├── liquid.rs │ │ ├── ops/ │ │ │ ├── core/ │ │ │ │ ├── broadcast.rs │ │ │ │ ├── cast.rs │ │ │ │ ├── complex.rs │ │ │ │ ├── downsample.rs │ │ │ │ ├── dyn_slice.rs │ │ │ │ ├── einsum.rs │ │ │ │ ├── fft.rs │ │ │ │ ├── gather.rs │ │ │ │ ├── gelu_approximate.rs │ │ │ │ ├── is_inf.rs │ │ │ │ ├── matmul.rs │ │ │ │ ├── one_hot.rs │ │ │ │ ├── qconv.rs │ │ │ │ ├── qmatmul.rs │ │ │ │ ├── range.rs │ │ │ │ ├── reduce.rs │ │ │ │ ├── rms_norm.rs │ │ │ │ ├── scan.rs │ │ │ │ ├── scatter.rs │ │ │ │ ├── shape_of.rs │ │ │ │ ├── silu.rs │ │ │ │ ├── softmax.rs │ │ │ │ ├── source.rs │ │ │ │ ├── submodel.rs │ │ │ │ ├── topk.rs │ │ │ │ └── trilu.rs │ │ │ ├── core.rs │ │ │ ├── mod.rs │ │ │ ├── nnef/ │ │ │ │ ├── deser.rs │ │ │ │ ├── mod.rs │ │ │ │ └── ser.rs │ │ │ └── resource.rs │ │ ├── registry.rs │ │ ├── resource.rs │ │ ├── ser.rs │ │ ├── tensors.rs │ │ └── transform.rs │ ├── stdlib.nnef │ └── tests/ │ ├── alexnet.nnef │ └── parse.rs ├── onnx/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── benches/ │ │ ├── linear_classifier.rs │ │ └── linear_regressor.rs │ ├── build-proto.rs │ ├── protos/ │ │ └── onnx/ │ │ ├── onnx-operators.proto3 │ │ ├── onnx.proto │ │ └── onnx.proto3 │ ├── src/ │ │ ├── data_resolver.rs │ │ ├── lib.rs │ │ ├── model.rs │ │ ├── ops/ │ │ │ ├── array/ │ │ │ │ ├── compress.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── nonzero.rs │ │ │ │ ├── one_hot.rs │ │ │ │ ├── pad.rs │ │ │ │ ├── shape.rs │ │ │ │ ├── slice.rs │ │ │ │ ├── split.rs │ │ │ │ ├── squeeze.rs │ │ │ │ ├── topk.rs │ │ │ │ ├── trilu.rs │ │ │ │ └── unsqueeze.rs │ │ │ ├── cast.rs │ │ │ ├── cumsum.rs │ │ │ ├── d2s.rs │ │ │ ├── einsum.rs │ │ │ ├── fft.rs │ │ │ ├── grid_sample.rs │ │ │ ├── logic.rs │ │ │ ├── math/ │ │ │ │ ├── clip.rs │ │ │ │ ├── gemm.rs │ │ │ │ ├── mat_mul_integer.rs │ │ │ │ ├── pow.rs │ │ │ │ └── rem.rs │ │ │ ├── math.rs │ │ │ ├── ml/ │ │ │ │ ├── category_mapper.rs │ │ │ │ ├── linear_classifier.rs │ │ │ │ ├── linear_regressor.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── normalizer.rs │ │ │ │ └── tree_ensemble_classifier.rs │ │ │ ├── mod.rs │ │ │ ├── multinomial.rs │ │ │ ├── nn/ │ │ │ │ ├── batch_norm.rs │ │ │ │ ├── conv_transpose.rs │ │ │ │ ├── dropout.rs │ │ │ │ ├── instance_norm.rs │ │ │ │ ├── layer_norm.rs │ │ │ │ ├── lrn.rs │ │ │ │ ├── mod.rs │ │ │ │ └── reduce.rs │ │ │ ├── non_max_suppression.rs │ │ │ ├── quant.rs │ │ │ ├── random.rs │ │ │ ├── rec/ │ │ │ │ ├── common.rs │ │ │ │ ├── gru.rs │ │ │ │ ├── lstm.rs │ │ │ │ ├── rnn.rs │ │ │ │ └── scan.rs │ │ │ ├── rec.rs │ │ │ ├── resize.rs │ │ │ └── s2d.rs │ │ ├── pb_helpers.rs │ │ ├── prost/ │ │ │ └── onnx.rs │ │ └── tensor.rs │ └── test_cases/ │ ├── byte_sb_bidi_lstm/ │ │ ├── README.md │ │ ├── generate_io.py │ │ ├── io.npz │ │ └── model.onnx │ ├── deconv_group/ │ │ ├── io.npz │ │ ├── model.onnx │ │ └── vars.sh │ ├── lgbm_classifier_tensor/ │ │ ├── generate_io.py │ │ ├── io.npz │ │ ├── model.onnx │ │ └── vars.sh │ ├── lgbm_regressor_tensor/ │ │ ├── generate_io.py │ │ ├── io.npz │ │ ├── model.onnx │ │ └── vars.sh │ ├── linear_classifier/ │ │ └── model.onnx │ ├── linear_regressor/ │ │ └── model.onnx │ ├── qlstm_3-2-3_T3_S1/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── qrelu_1/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── qrelu_2/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── qsigmoid_1/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── qsigmoid_2/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── qtanh_1/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── qtanh_2/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── qtdnn_10x5_101_i32_biases/ │ │ ├── final.mdl │ │ ├── io.npz │ │ ├── model.onnx │ │ ├── model.raw │ │ └── vars.sh │ ├── run_all.sh │ ├── tinyyolov2/ │ │ ├── io.npz │ │ └── vars.sh │ ├── transformer-mlm/ │ │ ├── generate_io.py │ │ ├── io.npz │ │ └── vars.sh │ ├── xgboost_classifier_tree/ │ │ ├── generate_io.py │ │ ├── io.npz │ │ ├── model.onnx │ │ └── vars.sh │ └── xgboost_regressor_tree/ │ ├── generate_io.py │ ├── io.npz │ ├── model.onnx │ └── vars.sh ├── onnx-opl/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src/ │ ├── grid_sample.rs │ ├── lib.rs │ ├── lrn.rs │ ├── ml/ │ │ ├── category_mapper.rs │ │ ├── mod.rs │ │ ├── tree.rs │ │ └── tree_ensemble_classifier.rs │ ├── multinomial.rs │ ├── non_max_suppression.rs │ ├── random.rs │ └── resize.rs ├── post-release.sh ├── pulse/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src/ │ ├── fact.rs │ ├── lib.rs │ ├── macros.rs │ ├── model.rs │ └── ops/ │ ├── array/ │ │ ├── broadcast.rs │ │ ├── concat.rs │ │ ├── mask.rs │ │ ├── mod.rs │ │ ├── pad.rs │ │ └── slice.rs │ ├── cnn/ │ │ ├── conv.rs │ │ ├── deconv.rs │ │ ├── mod.rs │ │ └── pools.rs │ ├── delay.rs │ ├── downsample.rs │ ├── dummy.rs │ ├── fft.rs │ ├── identity.rs │ ├── mask.rs │ ├── mod.rs │ ├── scan.rs │ ├── slice.rs │ └── source.rs ├── pulse-opl/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ └── src/ │ ├── concat.rs │ ├── deconv_delay.rs │ ├── delay.rs │ ├── lib.rs │ ├── mask.rs │ ├── pad.rs │ └── slice.rs ├── release.sh ├── rustfmt.toml ├── tensorflow/ │ ├── Cargo.toml │ ├── LICENSE │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── benches/ │ │ └── hey_snips_3.pb │ ├── build-proto.rs │ ├── examples/ │ │ └── plus3.rs │ ├── protos/ │ │ └── tensorflow/ │ │ └── core/ │ │ ├── framework/ │ │ │ ├── attr_value.proto │ │ │ ├── function.proto │ │ │ ├── graph.proto │ │ │ ├── node_def.proto │ │ │ ├── op_def.proto │ │ │ ├── resource_handle.proto │ │ │ ├── tensor.proto │ │ │ ├── tensor_shape.proto │ │ │ ├── types.proto │ │ │ ├── variable.proto │ │ │ └── versions.proto │ │ └── protobuf/ │ │ ├── meta_graph.proto │ │ ├── saved_model.proto │ │ ├── saved_object_graph.proto │ │ ├── saver.proto │ │ ├── struct.proto │ │ └── trackable_object_graph.proto │ ├── src/ │ │ ├── conform/ │ │ │ ├── mod.rs │ │ │ └── tf.rs │ │ ├── lib.rs │ │ ├── model.rs │ │ ├── ops/ │ │ │ ├── array/ │ │ │ │ ├── concatv2.rs │ │ │ │ ├── expand_dims.rs │ │ │ │ ├── fill.rs │ │ │ │ ├── gather_nd.rs │ │ │ │ ├── gather_v2.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── pack.rs │ │ │ │ ├── pad.rs │ │ │ │ ├── squeeze.rs │ │ │ │ └── transpose.rs │ │ │ ├── control_flow.rs │ │ │ ├── logic.rs │ │ │ ├── math/ │ │ │ │ └── reduce.rs │ │ │ ├── math.rs │ │ │ ├── mod.rs │ │ │ ├── nn/ │ │ │ │ ├── conv2d.rs │ │ │ │ ├── dw_conv2d.rs │ │ │ │ ├── fused_batch_norm.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── pools.rs │ │ │ │ └── s2b/ │ │ │ │ ├── mod.rs │ │ │ │ ├── raw.rs │ │ │ │ └── unary.rs │ │ │ ├── quant.rs │ │ │ ├── random/ │ │ │ │ ├── mod.rs │ │ │ │ ├── philox.rs │ │ │ │ └── random_uniform.rs │ │ │ └── rec/ │ │ │ ├── block_lstm.rs │ │ │ └── mod.rs │ │ ├── prost/ │ │ │ ├── google.protobuf.rs │ │ │ └── tensorflow.rs │ │ ├── tensor.rs │ │ └── tfpb.rs │ └── tests/ │ ├── models/ │ │ └── plus3.pb │ ├── ops_array_pack.rs │ ├── ops_array_strided_slice.proptest-regressions │ ├── ops_array_strided_slice.rs │ ├── ops_fake_quant_with_min_max_vars.rs │ ├── ops_nn_conv2d.proptest-regressions │ ├── ops_nn_conv2d.rs │ ├── ops_nn_dwconv2d.proptest-regressions │ ├── ops_nn_dwconv2d.rs │ ├── ops_nn_pools.proptest-regressions │ ├── ops_nn_pools.rs │ ├── ops_nn_space_to_batch.proptest-regressions │ ├── ops_nn_space_to_batch.rs │ ├── ops_random_uniform.rs │ └── utils/ │ └── mod.rs ├── test-rt/ │ ├── infra/ │ │ ├── Cargo.toml │ │ └── src/ │ │ └── lib.rs │ ├── suite-onnx/ │ │ ├── Cargo.toml │ │ ├── node.txt │ │ ├── pytorch-converted.txt │ │ ├── pytorch-operator.txt │ │ ├── simple.txt │ │ └── src/ │ │ └── lib.rs │ ├── suite-unit/ │ │ ├── Cargo.toml │ │ └── src/ │ │ ├── apply_rope.rs │ │ ├── bin_einsum.rs │ │ ├── binary.rs │ │ ├── conv_f16.rs │ │ ├── conv_f32.rs │ │ ├── conv_q.rs │ │ ├── deconv.rs │ │ ├── downsample.rs │ │ ├── elmwise.rs │ │ ├── gelu_approximate.rs │ │ ├── lib.rs │ │ ├── matmul_q40.rs │ │ ├── q_binary.rs │ │ ├── q_elmwise.rs │ │ ├── q_flavours.rs │ │ ├── q_helpers.rs │ │ ├── rms_norm.rs │ │ ├── scaled_masked_softmax.rs │ │ ├── sdpa.rs │ │ ├── silu.rs │ │ └── slice.rs │ ├── test-blas/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src/ │ │ │ └── lib.rs │ │ └── suite.rs │ ├── test-cuda/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src/ │ │ │ └── lib.rs │ │ └── suite.rs │ ├── test-f16/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src/ │ │ │ └── lib.rs │ │ └── suite.rs │ ├── test-metal/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── ggml_suite.rs │ │ ├── src/ │ │ │ └── lib.rs │ │ └── suite.rs │ ├── test-nnef-cycle/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src/ │ │ │ └── lib.rs │ │ └── suite.rs │ ├── test-onnx-core/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── debug-utils/ │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── save_all.py │ │ │ └── src/ │ │ │ └── main.rs │ │ ├── include-passing-ignored.sh │ │ └── src/ │ │ ├── bin/ │ │ │ └── reset-test-list.rs │ │ └── lib.rs │ ├── test-tflite/ │ │ ├── Cargo.toml │ │ ├── build.rs │ │ ├── src/ │ │ │ ├── lib.rs │ │ │ └── tflite_runtime.rs │ │ └── suite.rs │ └── test-unit-core/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── lib.rs │ └── main.rs ├── test-suite.sh ├── tflite/ │ ├── Cargo.toml │ ├── Readme.md │ ├── schema/ │ │ └── tflite.fbs │ └── src/ │ ├── lib.rs │ ├── model.rs │ ├── ops/ │ │ ├── array.rs │ │ ├── cnn.rs │ │ ├── element_wise.rs │ │ ├── math.rs │ │ ├── mod.rs │ │ └── nn.rs │ ├── registry.rs │ ├── rewriter.rs │ ├── ser.rs │ ├── tensors.rs │ └── tflite_generated.rs ├── transformers/ │ ├── Cargo.toml │ └── src/ │ ├── lib.rs │ ├── ops/ │ │ ├── apply_rope.rs │ │ ├── dyn_kv_cache.rs │ │ ├── flash_sdpa.rs │ │ ├── mod.rs │ │ ├── scaled_masked_softmax.rs │ │ ├── sdpa.rs │ │ └── streamed_sdpa.rs │ └── rewriter.rs └── yank.sh
Showing preview only (1,042K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (12902 symbols across 766 files)
FILE: api/c/mobilenet.c
function main (line 16) | int main() {
FILE: api/ffi/src/lib.rs
type TRACT_RESULT (line 19) | pub enum TRACT_RESULT {
function wrap (line 30) | fn wrap<F: FnOnce() -> anyhow::Result<()>>(func: F) -> TRACT_RESULT {
function tract_get_last_error (line 58) | pub extern "C" fn tract_get_last_error() -> *const std::ffi::c_char {
function tract_version (line 66) | pub extern "C" fn tract_version() -> *const std::ffi::c_char {
function tract_free_cstring (line 75) | pub unsafe extern "C" fn tract_free_cstring(ptr: *mut std::ffi::c_char) {
type TractNnef (line 105) | pub struct TractNnef(tract_rs::Nnef);
function tract_nnef_create (line 112) | pub unsafe extern "C" fn tract_nnef_create(nnef: *mut *mut TractNnef) ->...
function tract_nnef_enable_tract_core (line 121) | pub unsafe extern "C" fn tract_nnef_enable_tract_core(nnef: *mut TractNn...
function tract_nnef_enable_tract_extra (line 129) | pub unsafe extern "C" fn tract_nnef_enable_tract_extra(nnef: *mut TractN...
function tract_nnef_enable_tract_transformers (line 137) | pub unsafe extern "C" fn tract_nnef_enable_tract_transformers(
function tract_nnef_enable_onnx (line 147) | pub unsafe extern "C" fn tract_nnef_enable_onnx(nnef: *mut TractNnef) ->...
function tract_nnef_enable_pulse (line 155) | pub unsafe extern "C" fn tract_nnef_enable_pulse(nnef: *mut TractNnef) -...
function tract_nnef_enable_extended_identifier_syntax (line 163) | pub unsafe extern "C" fn tract_nnef_enable_extended_identifier_syntax(
function tract_nnef_destroy (line 174) | pub unsafe extern "C" fn tract_nnef_destroy(nnef: *mut *mut TractNnef) -...
function tract_nnef_load (line 183) | pub unsafe extern "C" fn tract_nnef_load(
function tract_nnef_load_buffer (line 205) | pub unsafe extern "C" fn tract_nnef_load_buffer(
function tract_nnef_write_model_to_tar (line 227) | pub unsafe extern "C" fn tract_nnef_write_model_to_tar(
function tract_nnef_write_model_to_tar_gz (line 244) | pub unsafe extern "C" fn tract_nnef_write_model_to_tar_gz(
function tract_nnef_write_model_to_dir (line 263) | pub unsafe extern "C" fn tract_nnef_write_model_to_dir(
type TractOnnx (line 277) | pub struct TractOnnx(tract_rs::Onnx);
function tract_onnx_create (line 284) | pub unsafe extern "C" fn tract_onnx_create(onnx: *mut *mut TractOnnx) ->...
function tract_onnx_destroy (line 294) | pub unsafe extern "C" fn tract_onnx_destroy(onnx: *mut *mut TractOnnx) -...
function tract_onnx_load (line 302) | pub unsafe extern "C" fn tract_onnx_load(
function tract_onnx_load_buffer (line 322) | pub unsafe extern "C" fn tract_onnx_load_buffer(
type TractInferenceModel (line 339) | pub struct TractInferenceModel(tract_rs::InferenceModel);
function tract_inference_model_input_count (line 343) | pub unsafe extern "C" fn tract_inference_model_input_count(
function tract_inference_model_output_count (line 357) | pub unsafe extern "C" fn tract_inference_model_output_count(
function tract_inference_model_input_name (line 373) | pub unsafe extern "C" fn tract_inference_model_input_name(
function tract_inference_model_output_name (line 391) | pub unsafe extern "C" fn tract_inference_model_output_name(
function tract_inference_model_input_fact (line 407) | pub unsafe extern "C" fn tract_inference_model_input_fact(
function tract_inference_model_set_input_fact (line 426) | pub unsafe extern "C" fn tract_inference_model_set_input_fact(
function tract_inference_model_output_fact (line 443) | pub unsafe extern "C" fn tract_inference_model_output_fact(
function tract_inference_model_set_output_fact (line 462) | pub unsafe extern "C" fn tract_inference_model_set_output_fact(
function tract_inference_model_analyse (line 477) | pub unsafe extern "C" fn tract_inference_model_analyse(
function tract_inference_model_into_model (line 494) | pub unsafe extern "C" fn tract_inference_model_into_model(
function tract_inference_model_destroy (line 511) | pub unsafe extern "C" fn tract_inference_model_destroy(
type TractModel (line 518) | pub struct TractModel(tract_rs::Model);
function tract_model_input_count (line 522) | pub unsafe extern "C" fn tract_model_input_count(
function tract_model_output_count (line 536) | pub unsafe extern "C" fn tract_model_output_count(
function tract_model_input_name (line 552) | pub unsafe extern "C" fn tract_model_input_name(
function tract_model_input_fact (line 570) | pub unsafe extern "C" fn tract_model_input_fact(
function tract_model_output_name (line 588) | pub unsafe extern "C" fn tract_model_output_name(
function tract_model_output_fact (line 606) | pub unsafe extern "C" fn tract_model_output_fact(
function tract_model_transform (line 622) | pub unsafe extern "C" fn tract_model_transform(
function tract_runnable_profile_json (line 637) | pub unsafe extern "C" fn tract_runnable_profile_json(
function tract_model_into_runnable (line 669) | pub unsafe extern "C" fn tract_model_into_runnable(
function tract_model_property_count (line 684) | pub unsafe extern "C" fn tract_model_property_count(
function tract_model_property_names (line 701) | pub unsafe extern "C" fn tract_model_property_names(
function tract_model_property (line 716) | pub unsafe extern "C" fn tract_model_property(
function tract_model_parse_fact (line 737) | pub unsafe extern "C" fn tract_model_parse_fact(
function tract_model_destroy (line 753) | pub unsafe extern "C" fn tract_model_destroy(model: *mut *mut TractModel...
type TractRuntime (line 758) | pub struct TractRuntime(tract_rs::Runtime);
function tract_runtime_for_name (line 765) | pub unsafe extern "C" fn tract_runtime_for_name(
function tract_runtime_name (line 781) | pub unsafe extern "C" fn tract_runtime_name(
function tract_runtime_prepare (line 800) | pub unsafe extern "C" fn tract_runtime_prepare(
function tract_runtime_release (line 815) | pub unsafe extern "C" fn tract_runtime_release(runtime: *mut *mut TractR...
type TractRunnable (line 820) | pub struct TractRunnable(tract_rs::Runnable);
function tract_runnable_spawn_state (line 831) | pub unsafe extern "C" fn tract_runnable_spawn_state(
function tract_runnable_run (line 853) | pub unsafe extern "C" fn tract_runnable_run(
function tract_runnable_input_count (line 867) | pub unsafe extern "C" fn tract_runnable_input_count(
function tract_runnable_output_count (line 881) | pub unsafe extern "C" fn tract_runnable_output_count(
function tract_runnable_input_fact (line 897) | pub unsafe extern "C" fn tract_runnable_input_fact(
function tract_runnable_output_fact (line 915) | pub unsafe extern "C" fn tract_runnable_output_fact(
function tract_runnable_property_count (line 931) | pub unsafe extern "C" fn tract_runnable_property_count(
function tract_runnable_property_names (line 948) | pub unsafe extern "C" fn tract_runnable_property_names(
function tract_runnable_property (line 963) | pub unsafe extern "C" fn tract_runnable_property(
function tract_runnable_release (line 981) | pub unsafe extern "C" fn tract_runnable_release(runnable: *mut *mut Trac...
type TractTensor (line 986) | pub struct TractTensor(tract_rs::Tensor);
function tract_tensor_from_bytes (line 997) | pub unsafe extern "C" fn tract_tensor_from_bytes(
function tract_tensor_dump (line 1020) | pub unsafe extern "C" fn tract_tensor_dump(
function tract_tensor_convert_to (line 1039) | pub unsafe extern "C" fn tract_tensor_convert_to(
function tract_tensor_destroy (line 1055) | pub unsafe extern "C" fn tract_tensor_destroy(tensor: *mut *mut TractTen...
function tract_tensor_as_bytes (line 1062) | pub unsafe extern "C" fn tract_tensor_as_bytes(
type TractState (line 1090) | pub struct TractState(tract_rs::State);
function tract_state_run (line 1101) | pub unsafe extern "C" fn tract_state_run(
function tract_state_input_count (line 1114) | pub unsafe extern "C" fn tract_state_input_count(
function tract_state_output_count (line 1128) | pub unsafe extern "C" fn tract_state_output_count(
function tract_state_destroy (line 1141) | pub unsafe extern "C" fn tract_state_destroy(state: *mut *mut TractState...
type TractFact (line 1146) | pub struct TractFact(tract_rs::Fact);
function tract_fact_rank (line 1150) | pub unsafe extern "C" fn tract_fact_rank(fact: *const TractFact, rank: *...
function tract_fact_datum_type (line 1160) | pub unsafe extern "C" fn tract_fact_datum_type(
function tract_fact_dim (line 1173) | pub unsafe extern "C" fn tract_fact_dim(
function tract_fact_dump (line 1190) | pub unsafe extern "C" fn tract_fact_dump(
function tract_fact_destroy (line 1202) | pub unsafe extern "C" fn tract_fact_destroy(fact: *mut *mut TractFact) -...
type TractInferenceFact (line 1207) | pub struct TractInferenceFact(tract_rs::InferenceFact);
function tract_inference_fact_parse (line 1213) | pub unsafe extern "C" fn tract_inference_fact_parse(
function tract_inference_fact_empty (line 1231) | pub unsafe extern "C" fn tract_inference_fact_empty(
function tract_inference_fact_dump (line 1245) | pub unsafe extern "C" fn tract_inference_fact_dump(
function tract_inference_fact_destroy (line 1258) | pub unsafe extern "C" fn tract_inference_fact_destroy(
type TractDim (line 1265) | pub struct TractDim(tract_rs::Dim);
function tract_dim_eval (line 1269) | pub unsafe extern "C" fn tract_dim_eval(
function tract_dim_to_int64 (line 1298) | pub unsafe extern "C" fn tract_dim_to_int64(fact: *const TractDim, i: *m...
function tract_dim_dump (line 1310) | pub unsafe extern "C" fn tract_dim_dump(
function tract_dim_destroy (line 1323) | pub unsafe extern "C" fn tract_dim_destroy(dim: *mut *mut TractDim) -> T...
function state_run (line 1331) | unsafe fn state_run(
FILE: api/proxy/src/lib.rs
function nnef (line 39) | pub fn nnef() -> Result<Nnef> {
function onnx (line 45) | pub fn onnx() -> Result<Onnx> {
function version (line 51) | pub fn version() -> &'static str {
type Model (line 57) | type Model = Model;
method load (line 58) | fn load(&self, path: impl AsRef<Path>) -> Result<Model> {
method load_buffer (line 68) | fn load_buffer(&self, data: &[u8]) -> Result<Model> {
method enable_tract_core (line 74) | fn enable_tract_core(&mut self) -> Result<()> {
method enable_tract_extra (line 78) | fn enable_tract_extra(&mut self) -> Result<()> {
method enable_tract_transformers (line 82) | fn enable_tract_transformers(&mut self) -> Result<()> {
method enable_onnx (line 86) | fn enable_onnx(&mut self) -> Result<()> {
method enable_pulse (line 90) | fn enable_pulse(&mut self) -> Result<()> {
method enable_extended_identifier_syntax (line 94) | fn enable_extended_identifier_syntax(&mut self) -> Result<()> {
method write_model_to_dir (line 98) | fn write_model_to_dir(&self, path: impl AsRef<Path>, model: &Model) -> R...
method write_model_to_tar (line 107) | fn write_model_to_tar(&self, path: impl AsRef<Path>, model: &Model) -> R...
method write_model_to_tar_gz (line 116) | fn write_model_to_tar_gz(&self, path: impl AsRef<Path>, model: &Model) -...
type InferenceModel (line 130) | type InferenceModel = InferenceModel;
method load (line 131) | fn load(&self, path: impl AsRef<Path>) -> Result<InferenceModel> {
method load_buffer (line 141) | fn load_buffer(&self, data: &[u8]) -> Result<InferenceModel> {
type Model (line 151) | type Model = Model;
type InferenceFact (line 152) | type InferenceFact = InferenceFact;
method input_count (line 153) | fn input_count(&self) -> Result<usize> {
method output_count (line 159) | fn output_count(&self) -> Result<usize> {
method input_name (line 165) | fn input_name(&self, id: usize) -> Result<String> {
method output_name (line 175) | fn output_name(&self, id: usize) -> Result<String> {
method input_fact (line 185) | fn input_fact(&self, id: usize) -> Result<InferenceFact> {
method set_input_fact (line 191) | fn set_input_fact(
method output_fact (line 201) | fn output_fact(&self, id: usize) -> Result<InferenceFact> {
method set_output_fact (line 207) | fn set_output_fact(
method analyse (line 217) | fn analyse(&mut self) -> Result<()> {
method into_model (line 222) | fn into_model(mut self) -> Result<Self::Model> {
type Fact (line 233) | type Fact = Fact;
type Tensor (line 234) | type Tensor = Tensor;
type Runnable (line 235) | type Runnable = Runnable;
method input_count (line 236) | fn input_count(&self) -> Result<usize> {
method output_count (line 242) | fn output_count(&self) -> Result<usize> {
method input_name (line 248) | fn input_name(&self, id: usize) -> Result<String> {
method output_name (line 258) | fn output_name(&self, id: usize) -> Result<String> {
method input_fact (line 268) | fn input_fact(&self, id: usize) -> Result<Fact> {
method output_fact (line 274) | fn output_fact(&self, id: usize) -> Result<Fact> {
method into_runnable (line 280) | fn into_runnable(self) -> Result<Runnable> {
method transform (line 287) | fn transform(&mut self, spec: impl Into<TransformSpec>) -> Result<()> {
method property_keys (line 294) | fn property_keys(&self) -> Result<Vec<String>> {
method property (line 310) | fn property(&self, name: impl AsRef<str>) -> Result<Tensor> {
method parse_fact (line 317) | fn parse_fact(&self, spec: &str) -> Result<Self::Fact> {
function runtime_for_name (line 328) | pub fn runtime_for_name(name: &str) -> Result<Runtime> {
type Runnable (line 336) | type Runnable = Runnable;
type Model (line 338) | type Model = Model;
method name (line 340) | fn name(&self) -> Result<String> {
method prepare (line 350) | fn prepare(&self, model: Self::Model) -> Result<Self::Runnable> {
type Tensor (line 364) | type Tensor = Tensor;
type State (line 365) | type State = State;
type Fact (line 366) | type Fact = Fact;
method run (line 368) | fn run(&self, inputs: impl IntoInputs<Tensor>) -> Result<Vec<Tensor>> {
method spawn_state (line 372) | fn spawn_state(&self) -> Result<State> {
method input_count (line 378) | fn input_count(&self) -> Result<usize> {
method output_count (line 384) | fn output_count(&self) -> Result<usize> {
method input_fact (line 390) | fn input_fact(&self, id: usize) -> Result<Self::Fact> {
method output_fact (line 396) | fn output_fact(&self, id: usize) -> Result<Self::Fact> {
method property_keys (line 402) | fn property_keys(&self) -> Result<Vec<String>> {
method property (line 418) | fn property(&self, name: impl AsRef<str>) -> Result<Tensor> {
method cost_json (line 425) | fn cost_json(&self) -> Result<String> {
method profile_json (line 430) | fn profile_json<I, IV, IE>(&self, inputs: Option<I>) -> Result<String>
type Tensor (line 465) | type Tensor = Tensor;
type Fact (line 466) | type Fact = Fact;
method run (line 468) | fn run(&mut self, inputs: impl IntoInputs<Tensor>) -> Result<Vec<Tensor>> {
method input_count (line 477) | fn input_count(&self) -> Result<usize> {
method output_count (line 483) | fn output_count(&self) -> Result<usize> {
method from_bytes (line 496) | fn from_bytes(dt: DatumType, shape: &[usize], data: &[u8]) -> Result<Sel...
method as_bytes (line 509) | fn as_bytes(&self) -> Result<(DatumType, &[usize], &[u8])> {
method datum_type (line 524) | fn datum_type(&self) -> Result<DatumType> {
method convert_to (line 539) | fn convert_to(&self, to: DatumType) -> Result<Self> {
method eq (line 547) | fn eq(&self, other: &Self) -> bool {
method new (line 560) | fn new(model: &Model, spec: impl ToString) -> Result<Fact> {
method dump (line 567) | fn dump(&self) -> Result<String> {
type Dim (line 579) | type Dim = Dim;
method datum_type (line 581) | fn datum_type(&self) -> Result<DatumType> {
method rank (line 587) | fn rank(&self) -> Result<usize> {
method dim (line 593) | fn dim(&self, axis: usize) -> Result<Self::Dim> {
method fmt (line 601) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method new (line 613) | fn new(model: &InferenceModel, spec: impl ToString) -> Result<InferenceF...
method dump (line 620) | fn dump(&self) -> Result<String> {
method empty (line 632) | fn empty() -> Result<InferenceFact> {
method default (line 640) | fn default() -> Self {
method fmt (line 646) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method dump (line 661) | fn dump(&self) -> Result<String> {
method eval (line 673) | fn eval(&self, values: impl IntoIterator<Item = (impl AsRef<str>, i64)>)...
method to_int64 (line 683) | fn to_int64(&self) -> Result<i64> {
method fmt (line 691) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
FILE: api/proxy/sys/build.rs
function main (line 4) | fn main() {
FILE: api/proxy/sys/tract.h
type DatumType (line 5) | typedef enum DatumType {
type TRACT_RESULT (line 32) | typedef enum TRACT_RESULT {
type TractDim (line 46) | typedef struct TractDim TractDim;
type TractFact (line 48) | typedef struct TractFact TractFact;
type TractInferenceFact (line 50) | typedef struct TractInferenceFact TractInferenceFact;
type TractInferenceModel (line 52) | typedef struct TractInferenceModel TractInferenceModel;
type TractModel (line 54) | typedef struct TractModel TractModel;
type TractNnef (line 56) | typedef struct TractNnef TractNnef;
type TractOnnx (line 58) | typedef struct TractOnnx TractOnnx;
type TractRunnable (line 60) | typedef struct TractRunnable TractRunnable;
type TractRuntime (line 62) | typedef struct TractRuntime TractRuntime;
type TractState (line 64) | typedef struct TractState TractState;
type TractTensor (line 66) | typedef struct TractTensor TractTensor;
type TRACT_RESULT (line 98) | enum TRACT_RESULT
type TractNnef (line 98) | struct TractNnef
type TRACT_RESULT (line 100) | enum TRACT_RESULT
type TractNnef (line 100) | struct TractNnef
type TRACT_RESULT (line 102) | enum TRACT_RESULT
type TractNnef (line 102) | struct TractNnef
type TRACT_RESULT (line 104) | enum TRACT_RESULT
type TractNnef (line 104) | struct TractNnef
type TRACT_RESULT (line 106) | enum TRACT_RESULT
type TractNnef (line 106) | struct TractNnef
type TRACT_RESULT (line 108) | enum TRACT_RESULT
type TractNnef (line 108) | struct TractNnef
type TRACT_RESULT (line 110) | enum TRACT_RESULT
type TractNnef (line 110) | struct TractNnef
type TRACT_RESULT (line 115) | enum TRACT_RESULT
type TractNnef (line 115) | struct TractNnef
type TRACT_RESULT (line 123) | enum TRACT_RESULT
type TractNnef (line 123) | struct TractNnef
type TractModel (line 125) | struct TractModel
type TRACT_RESULT (line 133) | enum TRACT_RESULT
type TractNnef (line 133) | struct TractNnef
type TractModel (line 136) | struct TractModel
type TRACT_RESULT (line 145) | enum TRACT_RESULT
type TractNnef (line 145) | struct TractNnef
type TractModel (line 147) | struct TractModel
type TRACT_RESULT (line 154) | enum TRACT_RESULT
type TractNnef (line 154) | struct TractNnef
type TractModel (line 156) | struct TractModel
type TRACT_RESULT (line 165) | enum TRACT_RESULT
type TractNnef (line 165) | struct TractNnef
type TractModel (line 167) | struct TractModel
type TRACT_RESULT (line 175) | enum TRACT_RESULT
type TractOnnx (line 175) | struct TractOnnx
type TRACT_RESULT (line 180) | enum TRACT_RESULT
type TractOnnx (line 180) | struct TractOnnx
type TRACT_RESULT (line 187) | enum TRACT_RESULT
type TractOnnx (line 187) | struct TractOnnx
type TractInferenceModel (line 189) | struct TractInferenceModel
type TRACT_RESULT (line 197) | enum TRACT_RESULT
type TractOnnx (line 197) | struct TractOnnx
type TractInferenceModel (line 200) | struct TractInferenceModel
type TRACT_RESULT (line 205) | enum TRACT_RESULT
type TractInferenceModel (line 205) | struct TractInferenceModel
type TRACT_RESULT (line 211) | enum TRACT_RESULT
type TractInferenceModel (line 211) | struct TractInferenceModel
type TRACT_RESULT (line 219) | enum TRACT_RESULT
type TractInferenceModel (line 219) | struct TractInferenceModel
type TRACT_RESULT (line 228) | enum TRACT_RESULT
type TractInferenceModel (line 228) | struct TractInferenceModel
type TRACT_RESULT (line 235) | enum TRACT_RESULT
type TractInferenceModel (line 235) | struct TractInferenceModel
type TractInferenceFact (line 237) | struct TractInferenceFact
type TRACT_RESULT (line 245) | enum TRACT_RESULT
type TractInferenceModel (line 245) | struct TractInferenceModel
type TractInferenceFact (line 247) | struct TractInferenceFact
type TRACT_RESULT (line 254) | enum TRACT_RESULT
type TractInferenceModel (line 254) | struct TractInferenceModel
type TractInferenceFact (line 256) | struct TractInferenceFact
type TRACT_RESULT (line 264) | enum TRACT_RESULT
type TractInferenceModel (line 264) | struct TractInferenceModel
type TractInferenceFact (line 266) | struct TractInferenceFact
type TRACT_RESULT (line 271) | enum TRACT_RESULT
type TractInferenceModel (line 271) | struct TractInferenceModel
type TRACT_RESULT (line 281) | enum TRACT_RESULT
type TractInferenceModel (line 281) | struct TractInferenceModel
type TractModel (line 282) | struct TractModel
type TRACT_RESULT (line 287) | enum TRACT_RESULT
type TractInferenceModel (line 287) | struct TractInferenceModel
type TRACT_RESULT (line 292) | enum TRACT_RESULT
type TractModel (line 292) | struct TractModel
type TRACT_RESULT (line 297) | enum TRACT_RESULT
type TractModel (line 297) | struct TractModel
type TRACT_RESULT (line 304) | enum TRACT_RESULT
type TractModel (line 304) | struct TractModel
type TRACT_RESULT (line 313) | enum TRACT_RESULT
type TractModel (line 313) | struct TractModel
type TractFact (line 315) | struct TractFact
type TRACT_RESULT (line 322) | enum TRACT_RESULT
type TractModel (line 322) | struct TractModel
type TRACT_RESULT (line 331) | enum TRACT_RESULT
type TractModel (line 331) | struct TractModel
type TractFact (line 333) | struct TractFact
type TRACT_RESULT (line 338) | enum TRACT_RESULT
type TractModel (line 338) | struct TractModel
type TRACT_RESULT (line 343) | enum TRACT_RESULT
type TractRunnable (line 343) | struct TractRunnable
type TractTensor (line 344) | struct TractTensor
type TRACT_RESULT (line 354) | enum TRACT_RESULT
type TractModel (line 354) | struct TractModel
type TractRunnable (line 355) | struct TractRunnable
type TRACT_RESULT (line 360) | enum TRACT_RESULT
type TractModel (line 360) | struct TractModel
type TRACT_RESULT (line 369) | enum TRACT_RESULT
type TractModel (line 369) | struct TractModel
type TRACT_RESULT (line 374) | enum TRACT_RESULT
type TractModel (line 374) | struct TractModel
type TractTensor (line 376) | struct TractTensor
type TRACT_RESULT (line 383) | enum TRACT_RESULT
type TractModel (line 383) | struct TractModel
type TractFact (line 385) | struct TractFact
type TRACT_RESULT (line 390) | enum TRACT_RESULT
type TractModel (line 390) | struct TractModel
type TRACT_RESULT (line 398) | enum TRACT_RESULT
type TractRuntime (line 398) | struct TractRuntime
type TRACT_RESULT (line 405) | enum TRACT_RESULT
type TractRuntime (line 405) | struct TractRuntime
type TRACT_RESULT (line 414) | enum TRACT_RESULT
type TractRuntime (line 414) | struct TractRuntime
type TractModel (line 415) | struct TractModel
type TractRunnable (line 416) | struct TractRunnable
type TRACT_RESULT (line 418) | enum TRACT_RESULT
type TractRuntime (line 418) | struct TractRuntime
type TRACT_RESULT (line 430) | enum TRACT_RESULT
type TractRunnable (line 430) | struct TractRunnable
type TractState (line 431) | struct TractState
type TRACT_RESULT (line 443) | enum TRACT_RESULT
type TractRunnable (line 443) | struct TractRunnable
type TractTensor (line 444) | struct TractTensor
type TractTensor (line 445) | struct TractTensor
type TRACT_RESULT (line 450) | enum TRACT_RESULT
type TractRunnable (line 450) | struct TractRunnable
type TRACT_RESULT (line 455) | enum TRACT_RESULT
type TractRunnable (line 455) | struct TractRunnable
type TRACT_RESULT (line 463) | enum TRACT_RESULT
type TractRunnable (line 463) | struct TractRunnable
type TractFact (line 465) | struct TractFact
type TRACT_RESULT (line 472) | enum TRACT_RESULT
type TractRunnable (line 472) | struct TractRunnable
type TractFact (line 474) | struct TractFact
type TRACT_RESULT (line 479) | enum TRACT_RESULT
type TractRunnable (line 479) | struct TractRunnable
type TRACT_RESULT (line 489) | enum TRACT_RESULT
type TractRunnable (line 489) | struct TractRunnable
type TRACT_RESULT (line 494) | enum TRACT_RESULT
type TractRunnable (line 494) | struct TractRunnable
type TractTensor (line 496) | struct TractTensor
type TRACT_RESULT (line 498) | enum TRACT_RESULT
type TractRunnable (line 498) | struct TractRunnable
type TRACT_RESULT (line 510) | enum TRACT_RESULT
type TractTensor (line 514) | struct TractTensor
type TRACT_RESULT (line 521) | enum TRACT_RESULT
type TractTensor (line 521) | struct TractTensor
type TRACT_RESULT (line 532) | enum TRACT_RESULT
type TractTensor (line 532) | struct TractTensor
type TractTensor (line 534) | struct TractTensor
type TRACT_RESULT (line 539) | enum TRACT_RESULT
type TractTensor (line 539) | struct TractTensor
type TRACT_RESULT (line 545) | enum TRACT_RESULT
type TractTensor (line 545) | struct TractTensor
type TRACT_RESULT (line 561) | enum TRACT_RESULT
type TractState (line 561) | struct TractState
type TractTensor (line 562) | struct TractTensor
type TractTensor (line 563) | struct TractTensor
type TRACT_RESULT (line 568) | enum TRACT_RESULT
type TractState (line 568) | struct TractState
type TRACT_RESULT (line 573) | enum TRACT_RESULT
type TractState (line 573) | struct TractState
type TRACT_RESULT (line 575) | enum TRACT_RESULT
type TractState (line 575) | struct TractState
type TRACT_RESULT (line 580) | enum TRACT_RESULT
type TractFact (line 580) | struct TractFact
type TRACT_RESULT (line 585) | enum TRACT_RESULT
type TractFact (line 585) | struct TractFact
type TRACT_RESULT (line 590) | enum TRACT_RESULT
type TractFact (line 590) | struct TractFact
type TractDim (line 592) | struct TractDim
type TRACT_RESULT (line 599) | enum TRACT_RESULT
type TractFact (line 599) | struct TractFact
type TRACT_RESULT (line 601) | enum TRACT_RESULT
type TractFact (line 601) | struct TractFact
type TRACT_RESULT (line 608) | enum TRACT_RESULT
type TractInferenceModel (line 608) | struct TractInferenceModel
type TractInferenceFact (line 610) | struct TractInferenceFact
type TRACT_RESULT (line 617) | enum TRACT_RESULT
type TractInferenceFact (line 617) | struct TractInferenceFact
type TRACT_RESULT (line 624) | enum TRACT_RESULT
type TractInferenceFact (line 624) | struct TractInferenceFact
type TRACT_RESULT (line 629) | enum TRACT_RESULT
type TractInferenceFact (line 629) | struct TractInferenceFact
type TRACT_RESULT (line 634) | enum TRACT_RESULT
type TractDim (line 634) | struct TractDim
type TractDim (line 638) | struct TractDim
type TRACT_RESULT (line 645) | enum TRACT_RESULT
type TractDim (line 645) | struct TractDim
type TRACT_RESULT (line 652) | enum TRACT_RESULT
type TractDim (line 652) | struct TractDim
type TRACT_RESULT (line 657) | enum TRACT_RESULT
type TractDim (line 657) | struct TractDim
FILE: api/py/_static/version-switcher.js
function injectSwitcher (line 20) | function injectSwitcher() {
FILE: api/py/tests/mobilenet_onnx_test.py
function setup_module (line 9) | def setup_module(module):
function grace_hopper_1x3x224x244 (line 21) | def grace_hopper_1x3x224x244():
function test_version (line 24) | def test_version():
function test_onnx (line 27) | def test_onnx():
function test_state (line 38) | def test_state():
function test_nnef_register (line 50) | def test_nnef_register():
function test_nnef (line 53) | def test_nnef():
function test_inference_model (line 63) | def test_inference_model():
function test_typed_model (line 77) | def test_typed_model():
function test_runtime (line 86) | def test_runtime():
function test_concretize (line 95) | def test_concretize():
function test_concretize_builder (line 106) | def test_concretize_builder():
function test_concretize_raw_string (line 115) | def test_concretize_raw_string():
function test_pulse (line 124) | def test_pulse():
function test_pulse_builder (line 139) | def test_pulse_builder():
function test_pulse_raw_string (line 148) | def test_pulse_raw_string():
function test_runtime_fact (line 157) | def test_runtime_fact():
function test_runtime_properties (line 162) | def test_runtime_properties():
function test_f32_to_f16 (line 174) | def test_f32_to_f16():
function test_f32_to_f16_raw_string (line 183) | def test_f32_to_f16_raw_string():
function test_f16_to_f32 (line 192) | def test_f16_to_f32():
function test_f16_to_f32_raw_string (line 208) | def test_f16_to_f32_raw_string():
function test_typed_model_to_nnef_and_back (line 218) | def test_typed_model_to_nnef_and_back():
function test_cost (line 246) | def test_cost():
function test_profile (line 257) | def test_profile():
function test_transform_registry (line 273) | def test_transform_registry():
function test_fact_and_dims (line 286) | def test_fact_and_dims():
function test_fact_and_dims_iterators (line 300) | def test_fact_and_dims_iterators():
function test_runtime_fact_iterator (line 312) | def test_runtime_fact_iterator():
function test_value_method (line 322) | def test_value_method():
FILE: api/py/tract/__init__.py
function version (line 56) | def version() -> str:
function nnef (line 60) | def nnef() -> Nnef:
function onnx (line 64) | def onnx() -> Onnx:
FILE: api/py/tract/bindings.py
class TractError (line 4) | class TractError(Exception):
function check (line 22) | def check(err):
FILE: api/py/tract/dim.py
class Dim (line 5) | class Dim:
method __init__ (line 14) | def __init__(self, ptr):
method __del__ (line 17) | def __del__(self):
method __str__ (line 21) | def __str__(self):
method __int__ (line 24) | def __int__(self):
method _valid (line 27) | def _valid(self):
method dump (line 31) | def dump(self) -> str:
method eval (line 40) | def eval(self, values: Dict[str, int]) -> "Dim":
method to_int64 (line 55) | def to_int64(self) -> int:
FILE: api/py/tract/fact.py
class InferenceFact (line 5) | class InferenceFact:
method __init__ (line 11) | def __init__(self, ptr):
method __del__ (line 14) | def __del__(self):
method __str__ (line 18) | def __str__(self):
method _valid (line 21) | def _valid(self):
method dump (line 25) | def dump(self) -> str:
class Fact (line 34) | class Fact:
method __init__ (line 41) | def __init__(self, ptr):
method __del__ (line 44) | def __del__(self):
method __str__ (line 48) | def __str__(self):
method _valid (line 51) | def _valid(self):
method datum_type (line 55) | def datum_type(self) -> int:
method rank (line 62) | def rank(self) -> int:
method dim (line 69) | def dim(self, axis: int) -> Dim:
method dump (line 76) | def dump(self) -> str:
method dims (line 85) | def dims(self):
FILE: api/py/tract/inference_model.py
class InferenceModel (line 7) | class InferenceModel:
method __init__ (line 27) | def __init__(self, ptr):
method __del__ (line 30) | def __del__(self):
method _valid (line 34) | def _valid(self):
method into_model (line 38) | def into_model(self) -> Model:
method input_count (line 50) | def input_count(self) -> int:
method output_count (line 57) | def output_count(self) -> int:
method input_name (line 64) | def input_name(self, input_id: int) -> str:
method input_fact (line 73) | def input_fact(self, input_id: int) -> InferenceFact:
method set_input_fact (line 80) | def set_input_fact(self, input_id: int, fact: Union[InferenceFact, str...
method output_name (line 90) | def output_name(self, output_id: int) -> str:
method output_fact (line 99) | def output_fact(self, output_id: int) -> InferenceFact:
method set_output_fact (line 106) | def set_output_fact(self, output_id: int, fact: Union[InferenceFact, s...
method fact (line 116) | def fact(self, spec:str) -> InferenceFact:
method analyse (line 130) | def analyse(self) -> None:
method into_analysed (line 137) | def into_analysed(self) -> "InferenceModel":
FILE: api/py/tract/model.py
class Model (line 10) | class Model:
method __init__ (line 48) | def __init__(self, ptr):
method __del__ (line 51) | def __del__(self):
method _valid (line 55) | def _valid(self):
method input_count (line 59) | def input_count(self) -> int:
method output_count (line 66) | def output_count(self) -> int:
method input_name (line 73) | def input_name(self, input_id: int) -> str:
method input_fact (line 82) | def input_fact(self, input_id: int) -> Fact:
method output_name (line 89) | def output_name(self, output_id: int) -> str:
method output_fact (line 98) | def output_fact(self, output_id: int) -> Fact:
method transform (line 105) | def transform(self, transform: Union[str, "TransformSpec"]) -> None:
method into_runnable (line 120) | def into_runnable(self) -> Runnable:
method parse_fact (line 128) | def parse_fact(self, spec: str) -> Fact:
method property_keys (line 134) | def property_keys(self) -> List[str]:
method property (line 148) | def property(self, name: str) -> Tensor:
method input_facts (line 155) | def input_facts(self) -> List[Fact]:
method output_facts (line 158) | def output_facts(self):
FILE: api/py/tract/nnef.py
class Nnef (line 7) | class Nnef:
method __init__ (line 20) | def __init__(self):
method __del__ (line 25) | def __del__(self):
method _valid (line 28) | def _valid(self):
method load (line 32) | def load(self, path: Union[str, Path]) -> Model:
method with_tract_core (line 50) | def with_tract_core(self) -> "Nnef":
method with_tract_extra (line 58) | def with_tract_extra(self) -> "Nnef":
method with_tract_transformers (line 66) | def with_tract_transformers(self) -> "Nnef":
method with_onnx (line 74) | def with_onnx(self) -> "Nnef":
method with_pulse (line 82) | def with_pulse(self) -> "Nnef":
method with_extended_identifier_syntax (line 90) | def with_extended_identifier_syntax(self) -> "Nnef":
method write_model_to_dir (line 98) | def write_model_to_dir(self, model: Model, path: Union[str, Path]) -> ...
method write_model_to_tar (line 111) | def write_model_to_tar(self, model: Model, path: Union[str, Path]) -> ...
method write_model_to_tar_gz (line 124) | def write_model_to_tar_gz(self, model: Model, path: Union[str, Path]) ...
FILE: api/py/tract/onnx.py
class Onnx (line 7) | class Onnx:
method __init__ (line 30) | def __init__(self):
method __del__ (line 35) | def __del__(self):
method load (line 38) | def load(self, path: Union[str, Path]) -> InferenceModel:
FILE: api/py/tract/runnable.py
class Runnable (line 9) | class Runnable:
method __init__ (line 19) | def __init__(self, ptr):
method __del__ (line 22) | def __del__(self):
method _valid (line 25) | def _valid(self):
method input_count (line 29) | def input_count(self) -> int:
method output_count (line 36) | def output_count(self) -> int:
method input_fact (line 43) | def input_fact(self, input_id: int) -> Fact:
method output_fact (line 50) | def output_fact(self, output_id: int) -> Fact:
method property_keys (line 57) | def property_keys(self) -> List[str]:
method property (line 71) | def property(self, name: str) -> Tensor:
method run (line 78) | def run(self, inputs: List[Union[Tensor, numpy.ndarray]]) -> List[Tens...
method spawn_state (line 84) | def spawn_state(self) -> State:
method profile_json (line 91) | def profile_json(self, inputs: Union[None, List[Union[Tensor, numpy.nd...
method input_facts (line 117) | def input_facts(self) -> List[Fact]:
method output_facts (line 121) | def output_facts(self) -> List[Fact]:
FILE: api/py/tract/runtime.py
function runtime_for_name (line 8) | def runtime_for_name(name: str):
class Runtime (line 19) | class Runtime:
method __init__ (line 28) | def __init__(self, ptr):
method __del__ (line 31) | def __del__(self):
method _valid (line 34) | def _valid(self):
method name (line 38) | def name(self) -> str:
method prepare (line 47) | def prepare(self, model:Model) -> Runnable:
FILE: api/py/tract/state.py
class State (line 8) | class State:
method __init__ (line 17) | def __init__(self, ptr):
method __del__ (line 20) | def __del__(self):
method _valid (line 23) | def _valid(self):
method input_count (line 27) | def input_count(self) -> int:
method output_count (line 34) | def output_count(self) -> int:
method run (line 41) | def run(self, inputs: List[Union[Tensor, numpy.ndarray]]) -> List[Tens...
method freeze (line 64) | def freeze(self) -> "FrozenState":
class FrozenState (line 71) | class FrozenState:
method __init__ (line 77) | def __init__(self, ptr):
method __del__ (line 80) | def __del__(self):
method _valid (line 83) | def _valid(self):
method unfreeze (line 87) | def unfreeze(self) -> State:
FILE: api/py/tract/tensor.py
class DatumType (line 9) | class DatumType(IntEnum):
method __str__ (line 29) | def __str__(self) -> str:
method is_bool (line 32) | def is_bool(self) -> bool:
method is_number (line 35) | def is_number(self) -> bool:
method is_float (line 38) | def is_float(self) -> bool:
method is_signed (line 41) | def is_signed(self) -> bool:
method is_unsigned (line 44) | def is_unsigned(self) -> bool:
method ctype (line 47) | def ctype(self):
function dt_numpy_to_tract (line 72) | def dt_numpy_to_tract(dt):
class Tensor (line 86) | class Tensor:
method __init__ (line 95) | def __init__(self, ptr):
method __del__ (line 98) | def __del__(self):
method __str__ (line 102) | def __str__(self):
method _valid (line 105) | def _valid(self):
method __eq__ (line 109) | def __eq__(self, other):
method _parts (line 119) | def _parts(self) -> (DatumType, [int], c_void_p):
method from_numpy (line 130) | def from_numpy(array: numpy.ndarray) -> "Tensor":
method to_numpy (line 144) | def to_numpy(self) -> numpy.array:
method into_numpy (line 153) | def into_numpy(self) -> numpy.array:
method datum_type (line 159) | def datum_type(self) -> DatumType:
method convert_to (line 165) | def convert_to(self, to: DatumType) -> "Tensor":
method dump (line 171) | def dump(self):
FILE: api/py/tract/transform.py
class TransformSpec (line 8) | class TransformSpec(ABC):
method to_json (line 16) | def to_json(self) -> str:
class ConcretizeSymbols (line 21) | class ConcretizeSymbols(TransformSpec):
method __init__ (line 31) | def __init__(self, values: Optional[Dict[str, int]] = None):
method value (line 34) | def value(self, symbol: str, val: int) -> "ConcretizeSymbols":
method to_json (line 39) | def to_json(self) -> str:
class Pulse (line 43) | class Pulse(TransformSpec):
method __init__ (line 53) | def __init__(self, pulse: Union[str, int], *, symbol: Optional[str] = ...
method symbol (line 57) | def symbol(self, symbol: str) -> "Pulse":
method to_json (line 62) | def to_json(self) -> str:
class FloatPrecision (line 69) | class FloatPrecision(TransformSpec):
method __init__ (line 85) | def __init__(
method include (line 102) | def include(self, patterns: list) -> "FloatPrecision":
method exclude (line 107) | def exclude(self, patterns: list) -> "FloatPrecision":
method to_json (line 112) | def to_json(self) -> str:
FILE: api/rs/src/lib.rs
function nnef (line 53) | pub fn nnef() -> Result<Nnef> {
function onnx (line 57) | pub fn onnx() -> Result<Onnx> {
function runtime_for_name (line 61) | pub fn runtime_for_name(name: &str) -> Result<Runtime> {
function version (line 70) | pub fn version() -> &'static str {
type Nnef (line 74) | pub struct Nnef(tract_nnef::internal::Nnef);
method fmt (line 77) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Model (line 83) | type Model = Model;
method load (line 84) | fn load(&self, path: impl AsRef<Path>) -> Result<Model> {
method load_buffer (line 89) | fn load_buffer(&self, data: &[u8]) -> Result<Self::Model> {
method enable_tract_core (line 94) | fn enable_tract_core(&mut self) -> Result<()> {
method enable_tract_extra (line 99) | fn enable_tract_extra(&mut self) -> Result<()> {
method enable_tract_transformers (line 104) | fn enable_tract_transformers(&mut self) -> Result<()> {
method enable_onnx (line 109) | fn enable_onnx(&mut self) -> Result<()> {
method enable_pulse (line 114) | fn enable_pulse(&mut self) -> Result<()> {
method enable_extended_identifier_syntax (line 119) | fn enable_extended_identifier_syntax(&mut self) -> Result<()> {
method write_model_to_dir (line 124) | fn write_model_to_dir(&self, path: impl AsRef<Path>, model: &Model) -> R...
method write_model_to_tar (line 128) | fn write_model_to_tar(&self, path: impl AsRef<Path>, model: &Model) -> R...
method write_model_to_tar_gz (line 134) | fn write_model_to_tar_gz(&self, path: impl AsRef<Path>, model: &Model) -...
type Onnx (line 142) | pub struct Onnx(tract_onnx::Onnx);
method fmt (line 145) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type InferenceModel (line 151) | type InferenceModel = InferenceModel;
method load (line 152) | fn load(&self, path: impl AsRef<Path>) -> Result<Self::InferenceModel> {
method load_buffer (line 156) | fn load_buffer(&self, data: &[u8]) -> Result<Self::InferenceModel> {
type InferenceModel (line 162) | pub struct InferenceModel(tract_onnx::prelude::InferenceModel);
method fmt (line 165) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Model (line 171) | type Model = Model;
type InferenceFact (line 172) | type InferenceFact = InferenceFact;
method input_count (line 174) | fn input_count(&self) -> Result<usize> {
method output_count (line 178) | fn output_count(&self) -> Result<usize> {
method input_name (line 182) | fn input_name(&self, id: usize) -> Result<String> {
method output_name (line 187) | fn output_name(&self, id: usize) -> Result<String> {
method input_fact (line 192) | fn input_fact(&self, id: usize) -> Result<InferenceFact> {
method set_input_fact (line 196) | fn set_input_fact(
method output_fact (line 205) | fn output_fact(&self, id: usize) -> Result<InferenceFact> {
method set_output_fact (line 209) | fn set_output_fact(
method analyse (line 218) | fn analyse(&mut self) -> Result<()> {
method into_model (line 223) | fn into_model(self) -> Result<Self::Model> {
type Model (line 231) | pub struct Model(TypedModel);
type Fact (line 234) | type Fact = Fact;
type Runnable (line 235) | type Runnable = Runnable;
type Tensor (line 236) | type Tensor = Tensor;
method input_count (line 238) | fn input_count(&self) -> Result<usize> {
method output_count (line 242) | fn output_count(&self) -> Result<usize> {
method input_name (line 246) | fn input_name(&self, id: usize) -> Result<String> {
method output_name (line 251) | fn output_name(&self, id: usize) -> Result<String> {
method input_fact (line 256) | fn input_fact(&self, id: usize) -> Result<Fact> {
method output_fact (line 260) | fn output_fact(&self, id: usize) -> Result<Fact> {
method into_runnable (line 264) | fn into_runnable(self) -> Result<Runnable> {
method transform (line 269) | fn transform(&mut self, spec: impl Into<TransformSpec>) -> Result<()> {
method parse_fact (line 294) | fn parse_fact(&self, spec: &str) -> Result<Fact> {
method property_keys (line 299) | fn property_keys(&self) -> Result<Vec<String>> {
method property (line 303) | fn property(&self, name: impl AsRef<str>) -> Result<Tensor> {
type Runtime (line 314) | pub struct Runtime(&'static dyn tract_nnef::internal::Runtime);
method fmt (line 317) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Runnable (line 323) | type Runnable = Runnable;
type Model (line 325) | type Model = Model;
method name (line 327) | fn name(&self) -> Result<String> {
method prepare (line 331) | fn prepare(&self, model: Self::Model) -> Result<Self::Runnable> {
type Runnable (line 339) | pub struct Runnable(Arc<dyn tract_nnef::internal::Runnable>);
type Tensor (line 342) | type Tensor = Tensor;
type State (line 343) | type State = State;
type Fact (line 344) | type Fact = Fact;
method run (line 346) | fn run(&self, inputs: impl IntoInputs<Tensor>) -> Result<Vec<Tensor>> {
method spawn_state (line 350) | fn spawn_state(&self) -> Result<State> {
method input_count (line 354) | fn input_count(&self) -> Result<usize> {
method output_count (line 358) | fn output_count(&self) -> Result<usize> {
method input_fact (line 362) | fn input_fact(&self, id: usize) -> Result<Fact> {
method output_fact (line 366) | fn output_fact(&self, id: usize) -> Result<Fact> {
method property_keys (line 370) | fn property_keys(&self) -> Result<Vec<String>> {
method property (line 374) | fn property(&self, name: impl AsRef<str>) -> Result<Tensor> {
method cost_json (line 383) | fn cost_json(&self) -> Result<String> {
method profile_json (line 388) | fn profile_json<I, IV, IE>(&self, inputs: Option<I>) -> Result<String>
type State (line 422) | pub struct State(Box<dyn tract_nnef::internal::State>);
method fmt (line 425) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Fact (line 431) | type Fact = Fact;
type Tensor (line 432) | type Tensor = Tensor;
method input_count (line 434) | fn input_count(&self) -> Result<usize> {
method output_count (line 438) | fn output_count(&self) -> Result<usize> {
method run (line 442) | fn run(&mut self, inputs: impl IntoInputs<Tensor>) -> Result<Vec<Tensor>> {
type Tensor (line 452) | pub struct Tensor(Arc<InternalTensor>);
method datum_type (line 455) | fn datum_type(&self) -> Result<DatumType> {
method from_bytes (line 459) | fn from_bytes(dt: DatumType, shape: &[usize], data: &[u8]) -> Result<Sel...
method as_bytes (line 467) | fn as_bytes(&self) -> Result<(DatumType, &[usize], &[u8])> {
method convert_to (line 472) | fn convert_to(&self, to: DatumType) -> Result<Self> {
method eq (line 483) | fn eq(&self, other: &Self) -> bool {
method fmt (line 491) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Fact (line 497) | pub struct Fact(TypedFact);
method new (line 517) | fn new(model: &Model, spec: impl ToString) -> Result<Fact> {
type Dim (line 500) | type Dim = Dim;
method datum_type (line 502) | fn datum_type(&self) -> Result<DatumType> {
method rank (line 506) | fn rank(&self) -> Result<usize> {
method dim (line 510) | fn dim(&self, axis: usize) -> Result<Self::Dim> {
method fmt (line 525) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type InferenceFact (line 541) | pub struct InferenceFact(tract_onnx::prelude::InferenceFact);
method new (line 550) | fn new(model: &InferenceModel, spec: impl ToString) -> Result<Inferenc...
method empty (line 544) | fn empty() -> Result<InferenceFact> {
method fmt (line 557) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Dim (line 576) | pub struct Dim(TDim);
method eval (line 579) | fn eval(&self, values: impl IntoIterator<Item = (impl AsRef<str>, i64)>)...
method to_int64 (line 592) | fn to_int64(&self) -> Result<i64> {
method fmt (line 598) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function to_internal_dt (line 612) | fn to_internal_dt(it: DatumType) -> tract_nnef::prelude::DatumType {
function from_internal_dt (line 643) | fn from_internal_dt(it: tract_nnef::prelude::DatumType) -> Result<DatumT...
FILE: api/src/lib.rs
type NnefInterface (line 15) | pub trait NnefInterface: Debug + Sized {
method load (line 20) | fn load(&self, path: impl AsRef<Path>) -> Result<Self::Model>;
method load_buffer (line 25) | fn load_buffer(&self, data: &[u8]) -> Result<Self::Model>;
method enable_tract_core (line 28) | fn enable_tract_core(&mut self) -> Result<()>;
method enable_tract_extra (line 31) | fn enable_tract_extra(&mut self) -> Result<()>;
method enable_tract_transformers (line 34) | fn enable_tract_transformers(&mut self) -> Result<()>;
method enable_onnx (line 38) | fn enable_onnx(&mut self) -> Result<()>;
method enable_pulse (line 41) | fn enable_pulse(&mut self) -> Result<()>;
method enable_extended_identifier_syntax (line 47) | fn enable_extended_identifier_syntax(&mut self) -> Result<()>;
method with_tract_core (line 50) | fn with_tract_core(mut self) -> Result<Self> {
method with_tract_extra (line 56) | fn with_tract_extra(mut self) -> Result<Self> {
method with_tract_transformers (line 62) | fn with_tract_transformers(mut self) -> Result<Self> {
method with_onnx (line 68) | fn with_onnx(mut self) -> Result<Self> {
method with_pulse (line 74) | fn with_pulse(mut self) -> Result<Self> {
method with_extended_identifier_syntax (line 80) | fn with_extended_identifier_syntax(mut self) -> Result<Self> {
method write_model_to_dir (line 88) | fn write_model_to_dir(&self, path: impl AsRef<Path>, model: &Self::Mod...
method write_model_to_tar (line 95) | fn write_model_to_tar(&self, path: impl AsRef<Path>, model: &Self::Mod...
method write_model_to_tar_gz (line 96) | fn write_model_to_tar_gz(&self, path: impl AsRef<Path>, model: &Self::...
type OnnxInterface (line 99) | pub trait OnnxInterface: Debug {
method load (line 101) | fn load(&self, path: impl AsRef<Path>) -> Result<Self::InferenceModel>;
method load_buffer (line 103) | fn load_buffer(&self, data: &[u8]) -> Result<Self::InferenceModel>;
type InferenceModelInterface (line 106) | pub trait InferenceModelInterface: Debug + Sized {
method input_count (line 109) | fn input_count(&self) -> Result<usize>;
method output_count (line 110) | fn output_count(&self) -> Result<usize>;
method input_name (line 111) | fn input_name(&self, id: usize) -> Result<String>;
method output_name (line 112) | fn output_name(&self, id: usize) -> Result<String>;
method input_fact (line 114) | fn input_fact(&self, id: usize) -> Result<Self::InferenceFact>;
method set_input_fact (line 116) | fn set_input_fact(
method output_fact (line 122) | fn output_fact(&self, id: usize) -> Result<Self::InferenceFact>;
method set_output_fact (line 124) | fn set_output_fact(
method analyse (line 130) | fn analyse(&mut self) -> Result<()>;
method into_model (line 132) | fn into_model(self) -> Result<Self::Model>;
type ModelInterface (line 135) | pub trait ModelInterface: Debug + Sized {
method input_count (line 139) | fn input_count(&self) -> Result<usize>;
method output_count (line 141) | fn output_count(&self) -> Result<usize>;
method input_name (line 143) | fn input_name(&self, id: usize) -> Result<String>;
method output_name (line 145) | fn output_name(&self, id: usize) -> Result<String>;
method input_fact (line 147) | fn input_fact(&self, id: usize) -> Result<Self::Fact>;
method output_fact (line 149) | fn output_fact(&self, id: usize) -> Result<Self::Fact>;
method into_runnable (line 151) | fn into_runnable(self) -> Result<Self::Runnable>;
method transform (line 153) | fn transform(&mut self, spec: impl Into<TransformSpec>) -> Result<()>;
method property_keys (line 155) | fn property_keys(&self) -> Result<Vec<String>>;
method property (line 157) | fn property(&self, name: impl AsRef<str>) -> Result<Self::Tensor>;
method parse_fact (line 159) | fn parse_fact(&self, spec: &str) -> Result<Self::Fact>;
method input_facts (line 161) | fn input_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> {
method output_facts (line 168) | fn output_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> {
type RuntimeInterface (line 176) | pub trait RuntimeInterface: Debug {
method name (line 179) | fn name(&self) -> Result<String>;
method prepare (line 180) | fn prepare(&self, model: Self::Model) -> Result<Self::Runnable>;
type RunnableInterface (line 183) | pub trait RunnableInterface: Debug + Send + Sync {
method run (line 187) | fn run(&self, inputs: impl IntoInputs<Self::Tensor>) -> Result<Vec<Sel...
method input_count (line 191) | fn input_count(&self) -> Result<usize>;
method output_count (line 192) | fn output_count(&self) -> Result<usize>;
method input_fact (line 193) | fn input_fact(&self, id: usize) -> Result<Self::Fact>;
method output_fact (line 195) | fn output_fact(&self, id: usize) -> Result<Self::Fact>;
method input_facts (line 197) | fn input_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> {
method output_facts (line 204) | fn output_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> {
method property_keys (line 211) | fn property_keys(&self) -> Result<Vec<String>>;
method property (line 212) | fn property(&self, name: impl AsRef<str>) -> Result<Self::Tensor>;
method spawn_state (line 214) | fn spawn_state(&self) -> Result<Self::State>;
method cost_json (line 216) | fn cost_json(&self) -> Result<String>;
method profile_json (line 218) | fn profile_json<I, IV, IE>(&self, inputs: Option<I>) -> Result<String>
type StateInterface (line 225) | pub trait StateInterface: Debug {
method input_count (line 229) | fn input_count(&self) -> Result<usize>;
method output_count (line 230) | fn output_count(&self) -> Result<usize>;
method run (line 232) | fn run(&mut self, inputs: impl IntoInputs<Self::Tensor>) -> Result<Vec...
type TensorInterface (line 235) | pub trait TensorInterface: Debug + Sized + Clone + PartialEq + Send + Sy...
method datum_type (line 236) | fn datum_type(&self) -> Result<DatumType>;
method from_bytes (line 237) | fn from_bytes(dt: DatumType, shape: &[usize], data: &[u8]) -> Result<S...
method as_bytes (line 238) | fn as_bytes(&self) -> Result<(DatumType, &[usize], &[u8])>;
method from_slice (line 240) | fn from_slice<T: Datum>(shape: &[usize], data: &[T]) -> Result<Self> {
method as_slice (line 247) | fn as_slice<T: Datum>(&self) -> Result<&[T]> {
method as_shape_and_slice (line 259) | fn as_shape_and_slice<T: Datum>(&self) -> Result<(&[usize], &[T])> {
method shape (line 265) | fn shape(&self) -> Result<&[usize]> {
method view (line 270) | fn view<T: Datum>(&self) -> Result<ndarray::ArrayViewD<'_, T>> {
method view1 (line 275) | fn view1<T: Datum>(&self) -> Result<ndarray::ArrayView1<'_, T>> {
method view2 (line 279) | fn view2<T: Datum>(&self) -> Result<ndarray::ArrayView2<'_, T>> {
method view3 (line 283) | fn view3<T: Datum>(&self) -> Result<ndarray::ArrayView3<'_, T>> {
method view4 (line 287) | fn view4<T: Datum>(&self) -> Result<ndarray::ArrayView4<'_, T>> {
method view5 (line 291) | fn view5<T: Datum>(&self) -> Result<ndarray::ArrayView5<'_, T>> {
method view6 (line 295) | fn view6<T: Datum>(&self) -> Result<ndarray::ArrayView6<'_, T>> {
method convert_to (line 299) | fn convert_to(&self, to: DatumType) -> Result<Self>;
type FactInterface (line 302) | pub trait FactInterface: Debug + Display + Clone {
method datum_type (line 304) | fn datum_type(&self) -> Result<DatumType>;
method rank (line 305) | fn rank(&self) -> Result<usize>;
method dim (line 306) | fn dim(&self, axis: usize) -> Result<Self::Dim>;
method dims (line 308) | fn dims(&self) -> Result<impl Iterator<Item = Self::Dim>> {
type DimInterface (line 313) | pub trait DimInterface: Debug + Display + Clone {
method eval (line 314) | fn eval(&self, values: impl IntoIterator<Item = (impl AsRef<str>, i64)...
method to_int64 (line 315) | fn to_int64(&self) -> Result<i64>;
type InferenceFactInterface (line 318) | pub trait InferenceFactInterface: Debug + Display + Default + Clone {
method empty (line 319) | fn empty() -> Result<Self>;
type AsFact (line 322) | pub trait AsFact<M, F>: Debug {
method as_fact (line 323) | fn as_fact(&self, model: &M) -> Result<Bow<'_, F>>;
type DatumType (line 328) | pub enum DatumType {
method size_of (line 356) | pub fn size_of(&self) -> usize {
method is_bool (line 372) | pub fn is_bool(&self) -> bool {
method is_number (line 376) | pub fn is_number(&self) -> bool {
method is_unsigned (line 380) | pub fn is_unsigned(&self) -> bool {
method is_signed (line 385) | pub fn is_signed(&self) -> bool {
method is_float (line 390) | pub fn is_float(&self) -> bool {
type Datum (line 396) | pub trait Datum {
method datum_type (line 397) | fn datum_type() -> DatumType;
type IntoInputs (line 401) | pub trait IntoInputs<V: TensorInterface> {
method into_inputs (line 402) | fn into_inputs(self) -> Result<Vec<V>>;
function into_inputs (line 412) | fn into_inputs(self) -> Result<Vec<V>> {
function into_inputs (line 419) | fn into_inputs(self) -> Result<Vec<V>> {
function tensor (line 450) | pub fn tensor<V, T, E>(v: T) -> Result<V>
FILE: api/src/transform.rs
type TransformSpec (line 10) | pub struct TransformSpec(String);
method to_transform_string (line 14) | pub fn to_transform_string(&self) -> String {
method from (line 20) | fn from(s: &str) -> Self {
method from (line 26) | fn from(s: String) -> Self {
method from (line 32) | fn from(s: &String) -> Self {
type TransformConfig (line 42) | pub trait TransformConfig: serde::Serialize {
method name (line 44) | fn name(&self) -> &'static str;
method to_transform_string (line 49) | fn to_transform_string(&self) -> String {
type ConcretizeSymbols (line 86) | pub struct ConcretizeSymbols {
method new (line 91) | pub fn new() -> Self {
method value (line 96) | pub fn value(mut self, symbol: impl Into<String>, val: i64) -> Self {
type Pulse (line 113) | pub struct Pulse {
method new (line 121) | pub fn new(pulse: impl Into<String>) -> Self {
method symbol (line 126) | pub fn symbol(mut self, symbol: impl Into<String>) -> Self {
type FloatPrecision (line 144) | pub struct FloatPrecision {
method new (line 163) | pub fn new(from: DatumType, to: DatumType) -> Self {
method include (line 173) | pub fn include(mut self, patterns: Vec<String>) -> Self {
method exclude (line 179) | pub fn exclude(mut self, patterns: Vec<String>) -> Self {
function datum_type_to_str (line 153) | fn datum_type_to_str(dt: DatumType) -> &'static str {
FILE: api/tests/mobilenet/mod.rs
function grace_hopper (line 3) | fn grace_hopper() -> Tensor {
function ensure_models (line 9) | fn ensure_models() -> anyhow::Result<()> {
function test_onnx (line 34) | fn test_onnx() -> anyhow::Result<()> {
function test_state (line 52) | fn test_state() -> anyhow::Result<()> {
function test_nnef (line 71) | fn test_nnef() -> anyhow::Result<()> {
function test_inference_model (line 90) | fn test_inference_model() -> anyhow::Result<()> {
function test_typed_model (line 116) | fn test_typed_model() -> anyhow::Result<()> {
function test_runtime (line 129) | fn test_runtime() -> anyhow::Result<()> {
function test_concretize (line 141) | fn test_concretize() -> anyhow::Result<()> {
function test_concretize_raw_string (line 156) | fn test_concretize_raw_string() -> anyhow::Result<()> {
function test_pulse (line 169) | fn test_pulse() -> anyhow::Result<()> {
function test_pulse_raw_string (line 188) | fn test_pulse_raw_string() -> anyhow::Result<()> {
function test_runtime_fact (line 201) | fn test_runtime_fact() -> anyhow::Result<()> {
function test_runtime_properties (line 210) | fn test_runtime_properties() -> anyhow::Result<()> {
function test_f32_to_f16 (line 226) | fn test_f32_to_f16() -> anyhow::Result<()> {
function test_f32_to_f16_raw_string (line 242) | fn test_f32_to_f16_raw_string() -> anyhow::Result<()> {
function test_f16_to_f32 (line 255) | fn test_f16_to_f32() -> anyhow::Result<()> {
function test_f16_to_f32_raw_string (line 281) | fn test_f16_to_f32_raw_string() -> anyhow::Result<()> {
function test_typed_model_to_nnef_and_back (line 295) | fn test_typed_model_to_nnef_and_back() -> anyhow::Result<()> {
function test_cost (line 325) | fn test_cost() -> anyhow::Result<()> {
function test_profile (line 345) | fn test_profile() -> anyhow::Result<()> {
function test_transform_registry (line 359) | fn test_transform_registry() -> anyhow::Result<()> {
function test_fact_and_dims (line 378) | fn test_fact_and_dims() -> anyhow::Result<()> {
function test_fact_and_dims_iterators (line 395) | fn test_fact_and_dims_iterators() -> anyhow::Result<()> {
function test_runtime_fact_iterator (line 411) | fn test_runtime_fact_iterator() -> anyhow::Result<()> {
function test_tensor_methods (line 425) | fn test_tensor_methods() -> anyhow::Result<()> {
FILE: ci/tract-ci-minion/src/main.rs
type Config (line 24) | struct Config {
type Graphite (line 50) | struct Graphite {
type AwsCredentials (line 57) | struct AwsCredentials {
method fmt (line 63) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function default_workdir (line 68) | fn default_workdir() -> PathBuf {
function default_region (line 72) | fn default_region() -> Region {
function default_bucket (line 76) | fn default_bucket() -> String {
function default_tasks (line 80) | fn default_tasks() -> String {
function default_logs (line 84) | fn default_logs() -> String {
function default_products (line 88) | fn default_products() -> String {
function default_idle_sleep_secs (line 92) | fn default_idle_sleep_secs() -> usize {
function default_timeout_runtime_secs (line 96) | fn default_timeout_runtime_secs() -> usize {
function deser_region (line 100) | fn deser_region<'de, D>(d: D) -> Result<Region, D::Error>
function config_path (line 109) | fn config_path() -> PathBuf {
function read_config (line 119) | fn read_config(path: impl AsRef<Path>) -> Result<Config> {
function dl_task (line 127) | fn dl_task(task_name: &str) -> Result<()> {
function vars (line 152) | fn vars(task_name: &str) -> Result<HashMap<String, String>> {
function run_task (line 171) | fn run_task(task_name: &str, timeout: Duration) -> Result<()> {
type Timeout (line 256) | struct Timeout;
method fmt (line 260) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function consider_task (line 265) | fn consider_task(config: &Config, task: &Object) -> Result<bool> {
function run (line 296) | fn run(config: &Config) -> Result<bool> {
function config (line 311) | fn config() -> Result<Config> {
function bucket (line 319) | fn bucket(config: &Config) -> Result<Bucket> {
type Args (line 333) | struct Args {
function main_loop (line 343) | fn main_loop(args: &Args) -> Result<()> {
function signal_handler (line 381) | extern "C" fn signal_handler(sig: libc::size_t) -> libc::size_t {
function do_main (line 392) | fn do_main() -> anyhow::Result<()> {
function main (line 411) | fn main() {
FILE: cli/src/bench.rs
function criterion (line 7) | pub fn criterion(
function handle (line 25) | pub fn handle(
FILE: cli/src/compare.rs
function handle (line 16) | pub fn handle(
function handle_tensorflow (line 48) | pub fn handle_tensorflow(
function handle_tensorflow (line 59) | pub fn handle_tensorflow(
function handle_npz (line 135) | pub fn handle_npz(
function handle_pbdir (line 177) | pub fn handle_pbdir(
function handle_pbdir (line 188) | pub fn handle_pbdir(
function handle_twice (line 218) | pub fn handle_twice(
function handle_reference_stage (line 230) | pub fn handle_reference_stage(
function handle_with_model (line 244) | pub fn handle_with_model(
function handle_stream (line 286) | pub fn handle_stream(
function handle_stream (line 295) | pub fn handle_stream(
function compare (line 476) | pub fn compare<F, O>(
FILE: cli/src/cost.rs
function parse_costs (line 4) | pub fn parse_costs(spec: &str) -> TractResult<Vec<(Cost, usize)>> {
FILE: cli/src/dump.rs
function annotate_with_graph_def (line 28) | pub fn annotate_with_graph_def(
function annotate_with_tf_graph_def (line 46) | fn annotate_with_tf_graph_def(
function annotate_with_tflite_graph_def (line 73) | fn annotate_with_tflite_graph_def(
function annotate_with_onnx_model (line 82) | fn annotate_with_onnx_model(
function handle (line 112) | pub fn handle(
function rename_outputs (line 439) | fn rename_outputs(typed: &mut TypedModel, sub_matches: &clap::ArgMatches...
function mm_report (line 452) | pub fn mm_report(
FILE: cli/src/hwbench.rs
function handle (line 9) | pub(crate) fn handle() -> TractResult<()> {
function mmm (line 94) | fn mmm(dt: DatumType, m: usize, k: usize, n: usize) -> TractResult<()> {
FILE: cli/src/llm.rs
function handle (line 13) | pub fn handle(
function bench_pp (line 25) | pub fn bench_pp(
function bench_tg (line 58) | pub fn bench_tg(
function top_logits_rbo (line 121) | pub fn top_logits_rbo(test: &Tensor, reference: &Tensor, p: f64, depth: ...
FILE: cli/src/main.rs
constant QUALITY_COLORS (line 47) | pub const QUALITY_COLORS: [nu_ansi_term::Color; 5] = [LightGreen, Green,...
function info_usage (line 49) | fn info_usage(stage: &str, probe: Option<&Probe>) {
constant STAGES (line 68) | pub const STAGES: &[&str] = &[
function main (line 89) | fn main() -> TractResult<()> {
function dump_subcommand (line 358) | fn dump_subcommand() -> clap::Command {
function assertions_options (line 456) | fn assertions_options(command: clap::Command) -> clap::Command {
function bench_options (line 538) | fn bench_options(command: clap::Command) -> clap::Command {
function run_options (line 547) | fn run_options(command: clap::Command) -> clap::Command {
function output_options (line 616) | fn output_options(command: clap::Command) -> clap::Command {
function handle (line 715) | fn handle(matches: clap::ArgMatches, probe: Option<&Probe>) -> TractResu...
function nnef (line 927) | fn nnef(matches: &clap::ArgMatches) -> tract_nnef::internal::Nnef {
FILE: cli/src/memory_arena.rs
type MemArenaUsage (line 7) | struct MemArenaUsage {
method eval_from_schema (line 14) | pub fn eval_from_schema(
type MemArenaMetrics (line 27) | struct MemArenaMetrics {
method from_schema (line 37) | pub fn from_schema(schema: &DeviceMemSchema) -> TractResult<Self> {
function dump_metrics (line 81) | pub fn dump_metrics(
FILE: cli/src/params.rs
type Location (line 41) | enum Location {
method path (line 47) | fn path(&self) -> Cow<'_, std::path::Path> {
method is_dir (line 54) | fn is_dir(&self) -> bool {
method read (line 58) | fn read(&self) -> TractResult<Box<dyn Read>> {
method bytes (line 65) | fn bytes(&self) -> TractResult<Vec<u8>> {
method find (line 71) | fn find(s: impl AsRef<str>) -> TractResult<Self> {
type SomeGraphDef (line 99) | pub enum SomeGraphDef {
type ModelBuildingError (line 111) | pub struct ModelBuildingError(pub Box<dyn Model>, pub Box<dyn std::error...
method fmt (line 114) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method source (line 120) | fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
type PulsedModel (line 126) | type PulsedModel = ();
type Parameters (line 130) | pub struct Parameters {
method disco_model (line 158) | fn disco_model(matches: &clap::ArgMatches) -> TractResult<(Location, b...
method load_model (line 173) | fn load_model(
method use_onnx_test_case_data_set (line 350) | fn use_onnx_test_case_data_set(
method tensor_values_from_iter (line 390) | fn tensor_values_from_iter(
method parse_nnef_tensors (line 416) | pub fn parse_nnef_tensors(
method parse_set_and_hint (line 440) | pub fn parse_set_and_hint(
method parse_npz (line 459) | pub fn parse_npz(
method parse_tensors (line 481) | fn parse_tensors(
method load_and_declutter (line 601) | fn load_and_declutter(
method from_clap (line 831) | pub fn from_clap(matches: &clap::ArgMatches, probe: Option<&Probe>) ->...
method typed_model (line 1063) | pub(crate) fn typed_model(&self) -> Option<Arc<TypedModel>> {
method req_typed_model (line 1070) | pub(crate) fn req_typed_model(&self) -> Arc<TypedModel> {
method req_runnable (line 1075) | pub(crate) fn req_runnable(&self) -> TractResult<Arc<dyn Runnable>> {
type TfExt (line 153) | type TfExt = tract_tensorflow::model::TfModelExtensions;
type TfExt (line 155) | type TfExt = ();
function bench_limits_from_clap (line 1080) | pub fn bench_limits_from_clap(matches: &clap::ArgMatches) -> TractResult...
function display_params_from_clap (line 1106) | pub fn display_params_from_clap(
type Assertions (line 1156) | pub struct Assertions {
method from_clap (line 1169) | fn from_clap(sub: &clap::ArgMatches, symbol_table: &SymbolScope) -> Tr...
function http_client (line 1229) | fn http_client() -> TractResult<reqwest::blocking::Client> {
FILE: cli/src/plan_options.rs
function plan_options_from_subcommand (line 3) | pub fn plan_options_from_subcommand(sub_matches: &clap::ArgMatches) -> T...
FILE: cli/src/run.rs
function npz_add_tensor (line 21) | fn npz_add_tensor(npz: &mut NpzWriter<File>, name: String, tensor: &Tens...
function handle (line 46) | pub fn handle(
function run_regular_t (line 148) | fn run_regular_t<F, O>(
function run_regular (line 276) | fn run_regular(
FILE: cli/src/runtimes.rs
type UnoptimizedRuntime (line 4) | pub struct UnoptimizedRuntime;
method name (line 9) | fn name(&self) -> StaticName {
method prepare_with_options (line 13) | fn prepare_with_options(
method check (line 20) | fn check(&self) -> TractResult<()> {
FILE: cli/src/tensor.rs
function run_params_from_subcommand (line 8) | pub fn run_params_from_subcommand(
FILE: cli/src/utils.rs
function check_outputs (line 9) | pub fn check_outputs(got: &[Vec<TValue>], params: &Parameters) -> TractR...
function check_inferred (line 99) | pub fn check_inferred(got: &[InferenceFact], expected: &[InferenceFact])...
function clarify_tvalue (line 116) | pub fn clarify_tvalue(t: &TValue) -> TractResult<TValue> {
function clarify_tvalues (line 120) | pub fn clarify_tvalues(values: &TVec<TValue>) -> TractResult<TVec<TValue...
function clarify_typed_fact (line 124) | pub fn clarify_typed_fact<'a>(fact: impl Into<Cow<'a, TypedFact>>) -> Co...
function matches_pattern (line 137) | fn matches_pattern(op_name: &str, pattern: &str) -> bool {
function check_op_only (line 145) | pub fn check_op_only(model: &dyn Model, patterns: &[String]) -> TractRes...
function count_op (line 163) | pub fn count_op(model: &dyn Model, name: &str) -> TractResult<usize> {
FILE: core/src/axes/mapping.rs
type AxisPattern (line 12) | pub trait AxisPattern: std::fmt::Debug {
method search (line 13) | fn search(&self, mapping: &AxesMapping) -> Option<usize>;
method search (line 17) | fn search(&self, mapping: &AxesMapping) -> Option<usize> {
method search (line 23) | fn search(&self, mapping: &AxesMapping) -> Option<usize> {
method search (line 32) | fn search(&self, mapping: &AxesMapping) -> Option<usize> {
type AxesMapping (line 38) | pub struct AxesMapping {
method new (line 45) | pub fn new(
method for_numpy_matmul (line 54) | pub fn for_numpy_matmul(
method disconnected (line 90) | pub fn disconnected(inputs: &[&TypedFact], outputs: &[&TypedFact]) -> ...
method disconnected_for_ranks (line 96) | pub fn disconnected_for_ranks(inputs: &[usize], outputs: &[usize]) -> ...
method natural (line 116) | pub fn natural(inputs: &[&TypedFact], outputs: &[&TypedFact]) -> Tract...
method natural_for_rank (line 125) | pub fn natural_for_rank(
method iter_all_axes (line 137) | pub fn iter_all_axes(&self) -> impl Iterator<Item = &Axis> {
method iter_all_axes_mut (line 141) | pub fn iter_all_axes_mut(&mut self) -> impl Iterator<Item = &mut Axis> {
method input_count (line 145) | pub fn input_count(&self) -> usize {
method output_count (line 149) | pub fn output_count(&self) -> usize {
method axis_positions (line 153) | pub fn axis_positions(&self, io: InOut, p: impl AxisPattern) -> TractR...
method rank (line 161) | pub fn rank(&self, io: InOut) -> usize {
method search (line 168) | fn search(&self, p: impl AxisPattern) -> TractResult<usize> {
method axis (line 172) | pub fn axis(&self, p: impl AxisPattern) -> TractResult<&Axis> {
method axis_mut (line 176) | fn axis_mut(&mut self, p: impl AxisPattern) -> TractResult<&mut Axis> {
method axes (line 181) | pub fn axes(&self, io: InOut) -> impl Iterator<Item = &Axis> {
method track_axis (line 185) | pub fn track_axis(&self, from: impl AxisPattern, to: InOut) -> TractRe...
method renaming (line 191) | pub fn renaming(mut self, axis: impl AxisPattern, name: char) -> Tract...
method linking (line 202) | pub fn linking(
method sort (line 221) | fn sort(&mut self) {
method sorted (line 242) | fn sorted(mut self) -> AxesMapping {
method do_check (line 247) | fn do_check(&self) -> TractResult<()> {
method check (line 278) | pub fn check(self) -> TractResult<AxesMapping> {
method available_label (line 283) | pub fn available_label(&self) -> char {
method available_labels (line 287) | pub fn available_labels(&self) -> impl Iterator<Item = char> + '_ {
method is_element_wise_unary (line 291) | pub fn is_element_wise_unary(&self) -> bool {
method extract_sub_mapping (line 299) | pub fn extract_sub_mapping(
method relabel (line 331) | pub fn relabel(mut self) -> TractResult<AxesMapping> {
method remove_axis (line 338) | pub fn remove_axis(&self, repr: char) -> TractResult<AxesMapping> {
method remove_axis_occurency (line 363) | pub fn remove_axis_occurency(&self, slot: InOut, position: usize) -> T...
method remove_slot (line 391) | pub fn remove_slot(&self, slot: InOut) -> TractResult<AxesMapping> {
method with_extra_input (line 413) | pub fn with_extra_input(self, slot: usize) -> TractResult<AxesMapping> {
method with_extra_axis (line 425) | pub fn with_extra_axis(
method with_extra_axis_occurency (line 436) | pub fn with_extra_axis_occurency(
method translate_to_axis_ops (line 462) | pub fn translate_to_axis_ops(&self) -> TractResult<Vec<AxisOp>> {
method from_strs (line 491) | pub fn from_strs(
method to_strs (line 524) | pub fn to_strs(&self) -> (TVec<String>, TVec<String>) {
method change_axis_sink (line 552) | pub fn change_axis_sink(&self, io: InOut, change: &AxisOp) -> TractRes...
method direct (line 574) | pub fn direct(&self, a: InOut, b: InOut) -> bool {
method same_layout (line 578) | pub fn same_layout<D: DimLike>(
method axis_ops_to_canonical (line 595) | pub fn axis_ops_to_canonical(&self, io: InOut) -> TractResult<Vec<Axis...
method view_to_canonical (line 617) | pub fn view_to_canonical<D>(&self, io: InOut, view: &mut ArrayViewD<D>...
method view_to_canonical_mut (line 624) | pub fn view_to_canonical_mut<D>(
method compose (line 635) | pub fn compose(&self, other: &AxesMapping) -> TractResult<AxesMapping> {
type Err (line 654) | type Err = TractError;
method from_str (line 655) | fn from_str(s: &str) -> Result<Self, Self::Err> {
method fmt (line 667) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function m (line 677) | fn m(s: &str) -> AxesMapping {
function test_parse_transpose (line 682) | fn test_parse_transpose() {
function test_parse_diag (line 698) | fn test_parse_diag() {
function test_parse_adamar_product_explicit (line 711) | fn test_parse_adamar_product_explicit() {
function test_parse_inner_product_implicit (line 724) | fn test_parse_inner_product_implicit() {
function test_parse_batch_matmul (line 729) | fn test_parse_batch_matmul() {
function test_parse_outer_product (line 747) | fn test_parse_outer_product() {
function test_parse_bilinear (line 763) | fn test_parse_bilinear() {
function test_parse_complex_tensor_contraction (line 781) | fn test_parse_complex_tensor_contraction() {
function test_parse_complex_tensor_contraction_implicit (line 802) | fn test_parse_complex_tensor_contraction_implicit() {
function test_display_expr (line 807) | fn test_display_expr() {
function test_parse_pulsed_matmul (line 812) | fn test_parse_pulsed_matmul() {
function test_parse_pulsed_batch_matmul (line 830) | fn test_parse_pulsed_batch_matmul() {
function test_extract_sub_mapping (line 849) | fn test_extract_sub_mapping() {
function test_remove_axis_0 (line 856) | fn test_remove_axis_0() {
function test_translate_to_ops_rm_add (line 871) | fn test_translate_to_ops_rm_add() {
function test_translate_to_ops_add_0 (line 881) | fn test_translate_to_ops_add_0() {
function test_translate_to_ops_move (line 889) | fn test_translate_to_ops_move() {
function test_translate_to_ops_move_20 (line 894) | fn test_translate_to_ops_move_20() {
function test_translate_to_ops_complex (line 899) | fn test_translate_to_ops_complex() {
FILE: core/src/axes/mod.rs
type Axis (line 10) | pub struct Axis {
method new (line 17) | pub fn new(repr: char, inputs: usize, outputs: usize) -> Axis {
method natural (line 21) | pub fn natural(inputs: usize, outputs: usize, repr: char, axis_id: usi...
method input (line 28) | pub fn input(mut self, input_id: usize, axis: usize) -> Axis {
method output (line 33) | pub fn output(mut self, output_id: usize, axis: usize) -> Axis {
method inputs_count (line 38) | pub fn inputs_count(mut self, inputs: usize) -> Axis {
method outputs_count (line 43) | pub fn outputs_count(mut self, outputs: usize) -> Axis {
method ensure_inputs_count (line 48) | pub fn ensure_inputs_count(&mut self, inputs: usize) {
method ensure_outputs_count (line 54) | pub fn ensure_outputs_count(&mut self, outputs: usize) {
method add_input (line 60) | pub fn add_input(&mut self, input_id: usize, axis: usize) {
method add_output (line 65) | pub fn add_output(&mut self, output_id: usize, axis: usize) {
method interface (line 70) | pub fn interface(&self, io: InOut) -> &[usize] {
FILE: core/src/axes/model.rs
type OutletMap (line 4) | pub struct OutletMap<T>(Vec<TVec<Option<T>>>);
function insert (line 7) | fn insert(&mut self, outlet: OutletId, t: T) {
function remove (line 20) | fn remove(&mut self, outlet: &OutletId) -> Option<T> {
function get (line 29) | pub fn get(&self, outlet: &OutletId) -> Option<&T> {
function keys (line 38) | pub fn keys(&self) -> OutletMapKeysIter<'_, T> {
type Output (line 44) | type Output = T;
function index (line 45) | fn index(&self, index: &'a OutletId) -> &Self::Output {
type OutletMapKeysIter (line 50) | pub struct OutletMapKeysIter<'a, T>(&'a OutletMap<T>, OutletId);
type Item (line 53) | type Item = OutletId;
function next (line 54) | fn next(&mut self) -> Option<Self::Item> {
type AxisTracking (line 74) | pub struct AxisTracking {
method for_outlet_and_axis (line 81) | pub fn for_outlet_and_axis(
function full_axis_tracking (line 157) | pub fn full_axis_tracking(model: &TypedModel) -> TractResult<Vec<AxisTra...
function for_model (line 176) | pub fn for_model(model: &TypedModel) -> TractResult<AxesMapping> {
FILE: core/src/broadcast.rs
function multi_broadcast (line 5) | pub fn multi_broadcast<D>(shapes: &[impl AsRef<[D]>]) -> TractResult<TVe...
function onnx_1 (line 32) | fn onnx_1() {
function onnx_2 (line 37) | fn onnx_2() {
function onnx_3 (line 42) | fn onnx_3() {
function onnx_4 (line 50) | fn onnx_4() {
function onnx_5 (line 58) | fn onnx_5() {
FILE: core/src/floats.rs
type FloatPrecisionTranslator (line 13) | pub struct FloatPrecisionTranslator {
method new (line 21) | pub fn new(from_dt: DatumType, to_dt: DatumType) -> Self {
method with_filter (line 25) | pub fn with_filter(
method should_translate_node (line 33) | fn should_translate_node(&self, node: &TypedNode) -> bool {
method cast_inputs_if_required (line 40) | fn cast_inputs_if_required(
method cast_model_outputs_if_required (line 70) | fn cast_model_outputs_if_required(
method fmt (line 98) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method translate_node (line 121) | fn translate_node(
method name (line 107) | fn name(&self) -> StaticName {
method transform (line 111) | fn transform(&self, model: &mut TypedModel) -> TractResult<()> {
function build_f32_model (line 207) | fn build_f32_model() -> TractResult<TypedModel> {
function test_high_level_f16_transform_with_filter (line 225) | fn test_high_level_f16_transform_with_filter() -> TractResult<()> {
function test_f16_transform_with_filter (line 286) | fn test_f16_transform_with_filter() -> TractResult<()> {
FILE: core/src/framework.rs
type Framework (line 11) | pub trait Framework<ProtoModel, Model>: Send + Sync
method proto_model_for_read (line 17) | fn proto_model_for_read(&self, reader: &mut dyn Read) -> TractResult<P...
method model_for_proto_model (line 20) | fn model_for_proto_model(&self, proto: &ProtoModel) -> TractResult<Mod...
method model_for_proto_model_with_model_template (line 25) | fn model_for_proto_model_with_model_template(
method proto_model_for_path (line 32) | fn proto_model_for_path(&self, p: impl AsRef<Path>) -> TractResult<Pro...
method model_for_read (line 39) | fn model_for_read(&self, r: &mut dyn Read) -> TractResult<Model> {
method model_for_path (line 45) | fn model_for_path(&self, p: impl AsRef<Path>) -> TractResult<Model> {
FILE: core/src/late_bind.rs
type ResolveTo (line 4) | pub trait ResolveTo<Concrete> {
method resolve (line 6) | fn resolve(&self, param: &Self::Param) -> TractResult<Concrete>;
type GeometryBound (line 10) | pub enum GeometryBound<Symbolic, Concrete> {
function is_concrete (line 16) | pub fn is_concrete(&self) -> bool {
function into_concrete (line 23) | pub fn into_concrete(self, param: &S::Param) -> TractResult<Self> {
function to_concrete (line 30) | pub fn to_concrete(&self, param: &S::Param) -> TractResult<Cow<'_, C>> {
function as_concrete (line 37) | pub fn as_concrete(&self) -> Option<&C> {
function optimize_if (line 41) | pub fn optimize_if(self, param: Option<&S::Param>) -> TractResult<Self> {
function from (line 47) | fn from(s: S) -> Self {
FILE: core/src/lib.rs
function setup_test_logger (line 153) | fn setup_test_logger() {
FILE: core/src/model/fact.rs
type ShapeFact (line 9) | pub struct ShapeFact {
method rank (line 16) | pub fn rank(&self) -> usize {
method compute_concrete (line 20) | fn compute_concrete(&mut self) {
method as_concrete (line 28) | pub fn as_concrete(&self) -> Option<&[usize]> {
method is_concrete (line 34) | pub fn is_concrete(&self) -> bool {
method to_tvec (line 40) | pub fn to_tvec(&self) -> TVec<TDim> {
method volume (line 46) | pub fn volume(&self) -> TDim {
method eval (line 51) | pub fn eval(&self, values: &SymbolValues) -> TractResult<Cow<'_, Shape...
method eval_to_usize (line 60) | pub fn eval_to_usize(&self, values: &SymbolValues) -> TractResult<Cow<...
method eval_to_isize (line 73) | pub fn eval_to_isize(&self, values: &SymbolValues) -> TractResult<Cow<...
method from_dims (line 87) | pub fn from_dims<D: ToDim, T: IntoIterator<Item = D>>(it: T) -> ShapeF...
method dims (line 94) | pub fn dims(&self) -> &[TDim] {
method set (line 98) | pub fn set(&mut self, ix: usize, dim: TDim) {
method insert_axis (line 103) | pub fn insert_axis(&mut self, axis: usize) -> TractResult<()> {
method remove_axis (line 111) | pub fn remove_axis(&mut self, axis: usize) -> TractResult<()> {
method compatible_with (line 121) | pub fn compatible_with(&self, _other: &ShapeFact) -> bool {
method scalar (line 132) | pub fn scalar() -> ShapeFact {
method consistent (line 137) | pub fn consistent(&self) -> TractResult<()> {
type Target (line 147) | type Target = [TDim];
method deref (line 148) | fn deref(&self) -> &[TDim] {
method from (line 154) | fn from(it: T) -> ShapeFact {
method from_iter (line 181) | fn from_iter<T: IntoIterator<Item = D>>(iter: T) -> Self {
method fmt (line 187) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
method as_ref (line 194) | fn as_ref(&self) -> &[TDim] {
type Fact (line 161) | pub trait Fact:
method to_typed_fact (line 164) | fn to_typed_fact(&self) -> TractResult<Cow<'_, TypedFact>>;
method matches (line 166) | fn matches(&self, t: &Tensor, symbols: Option<&SymbolValues>) -> Tract...
method compatible_with (line 171) | fn compatible_with(&self, _other: &dyn Fact) -> bool;
method datum_type (line 173) | fn datum_type(&self) -> Option<DatumType>;
method to_typed_fact (line 372) | fn to_typed_fact(&self) -> TractResult<Cow<'_, TypedFact>> {
method matches (line 379) | fn matches(&self, t: &Tensor, symbols: Option<&SymbolValues>) -> Tract...
method compatible_with (line 394) | fn compatible_with(&self, other: &dyn Fact) -> bool {
method datum_type (line 414) | fn datum_type(&self) -> Option<DatumType> {
type TypedFact (line 201) | pub struct TypedFact {
method scalar (line 223) | pub fn scalar<T>() -> TypedFact
method shape (line 230) | pub fn shape<T, S>(shape: S) -> TypedFact
method shape_and_dt_of (line 238) | pub fn shape_and_dt_of(t: &Tensor) -> TypedFact {
method mem_size (line 254) | pub fn mem_size(&self) -> TDim {
method dt_scalar (line 259) | pub fn dt_scalar(datum_type: DatumType) -> TypedFact {
method dt_shape (line 271) | pub fn dt_shape<S>(datum_type: DatumType, shape: S) -> TypedFact
method rank (line 286) | pub fn rank(&self) -> usize {
method format_dt_shape_nocheck (line 293) | fn format_dt_shape_nocheck(&self) -> String {
method format_dt_shape (line 301) | pub fn format_dt_shape(&self) -> String {
method consistent (line 308) | pub fn consistent(&self) -> TractResult<()> {
method without_value (line 342) | pub fn without_value(&self) -> Self {
method with_exotic_fact (line 351) | pub fn with_exotic_fact<O: Into<Box<dyn ExoticFact>>>(mut self, exotic...
method exotic_fact (line 356) | pub fn exotic_fact(&self) -> Option<&dyn ExoticFact> {
method is_exotic (line 361) | pub fn is_exotic(&self) -> bool {
method is_plain (line 366) | pub fn is_plain(&self) -> bool {
type Error (line 420) | type Error = TractError;
method try_from (line 421) | fn try_from(t: Tensor) -> TractResult<TypedFact> {
type Error (line 427) | type Error = TractError;
method try_from (line 428) | fn try_from(t: Arc<Tensor>) -> TractResult<TypedFact> {
method from (line 453) | fn from(fact: &TypedFact) -> TypedFact {
type Error (line 459) | type Error = TractError;
method try_from (line 460) | fn try_from(t: &'a Arc<Tensor>) -> TractResult<TypedFact> {
method fmt (line 466) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
type DatumExt (line 491) | pub trait DatumExt {
method scalar_fact (line 492) | fn scalar_fact() -> TypedFact;
method fact (line 493) | fn fact<S>(shape: S) -> TypedFact
method scalar_fact (line 500) | fn scalar_fact() -> TypedFact {
method fact (line 504) | fn fact<S>(shape: S) -> TypedFact
type DatumTypeExt (line 512) | pub trait DatumTypeExt {
method scalar_fact (line 513) | fn scalar_fact(&self) -> TypedFact;
method fact (line 514) | fn fact<S>(&self, shape: S) -> TypedFact
method scalar_fact (line 521) | fn scalar_fact(&self) -> TypedFact {
method fact (line 525) | fn fact<S>(&self, shape: S) -> TypedFact
FILE: core/src/model/graph.rs
type SpecialOps (line 11) | pub trait SpecialOps<F, O> {
method create_dummy (line 12) | fn create_dummy(&self) -> O;
method create_source (line 13) | fn create_source(&self, fact: F) -> O;
method is_source (line 14) | fn is_source(op: &O) -> bool;
method wire_node (line 15) | fn wire_node(
method add_const (line 21) | fn add_const(
type Graph (line 32) | pub struct Graph<F, O>
method default (line 56) | fn default() -> Graph<F, O> {
function add_source (line 74) | pub fn add_source(&mut self, name: impl Into<String>, fact: F) -> TractR...
function add_node (line 88) | pub fn add_node(
function add_edge (line 105) | pub fn add_edge(&mut self, outlet: OutletId, inlet: InletId) -> TractRes...
function input_outlets (line 134) | pub fn input_outlets(&self) -> TractResult<&[OutletId]> {
function set_input_outlets (line 139) | pub fn set_input_outlets(&mut self, inputs: &[OutletId]) -> TractResult<...
function with_input_outlets (line 145) | pub fn with_input_outlets(mut self, inputs: &[OutletId]) -> TractResult<...
function set_input_names (line 151) | pub fn set_input_names(
function with_input_names (line 167) | pub fn with_input_names(
function input_fact (line 176) | pub fn input_fact(&self, ix: usize) -> TractResult<&F> {
function input_fact_mut (line 182) | pub fn input_fact_mut(&mut self, ix: usize) -> TractResult<&mut F> {
function set_input_fact (line 188) | pub fn set_input_fact(&mut self, input: usize, fact: F) -> TractResult<(...
function with_input_fact (line 194) | pub fn with_input_fact(mut self, input: usize, fact: F) -> TractResult<S...
function output_outlets (line 201) | pub fn output_outlets(&self) -> TractResult<&[OutletId]> {
function auto_outputs (line 206) | pub fn auto_outputs(&mut self) -> TractResult<()> {
function select_output_outlets (line 224) | pub fn select_output_outlets(&mut self, outputs: &[OutletId]) -> TractRe...
function with_output_outlets (line 230) | pub fn with_output_outlets(mut self, outputs: &[OutletId]) -> TractResul...
function select_outputs_by_name (line 236) | pub fn select_outputs_by_name(
function with_outputs_by_name (line 263) | pub fn with_outputs_by_name(
function output_fact (line 272) | pub fn output_fact(&self, ix: usize) -> TractResult<&F> {
function output_fact_mut (line 278) | pub fn output_fact_mut(&mut self, ix: usize) -> TractResult<&mut F> {
function set_output_fact (line 284) | pub fn set_output_fact(&mut self, output: usize, fact: F) -> TractResult...
function with_output_fact (line 290) | pub fn with_output_fact(mut self, output: usize, fact: F) -> TractResult...
function node_names (line 298) | pub fn node_names(&self) -> impl Iterator<Item = &str> {
function node_id_by_name (line 302) | pub fn node_id_by_name(&self, name: &str) -> TractResult<usize> {
function node_by_name (line 311) | pub fn node_by_name(&self, name: impl AsRef<str>) -> TractResult<&Node<F...
function node_by_name_mut (line 317) | pub fn node_by_name_mut(&mut self, name: impl AsRef<str>) -> TractResult...
function rename_node (line 322) | pub fn rename_node(&mut self, id: usize, name: &str) -> TractResult<()> {
function node (line 328) | pub fn node(&self, id: usize) -> &Node<F, O> {
function node_mut (line 333) | pub fn node_mut(&mut self, id: usize) -> &mut Node<F, O> {
function nodes (line 338) | pub fn nodes(&self) -> &[Node<F, O>] {
function nodes_mut (line 343) | pub fn nodes_mut(&mut self) -> &mut [Node<F, O>] {
function node_facts (line 348) | pub fn node_facts(&self, id: usize) -> TractResult<(TVec<&F>, TVec<&F>)> {
function node_input_facts (line 353) | pub fn node_input_facts(&self, node_id: usize) -> TractResult<TVec<&F>> {
function node_output_facts (line 358) | pub fn node_output_facts(&self, node_id: usize) -> TractResult<TVec<&F>> {
function outlet_fact (line 365) | pub fn outlet_fact(&self, outlet: OutletId) -> TractResult<&F> {
function outlet_fact_mut (line 375) | pub fn outlet_fact_mut(&mut self, outlet: OutletId) -> TractResult<&mut ...
function outlets_fact_mut (line 384) | pub fn outlets_fact_mut(&mut self, outlets: &[OutletId]) -> TractResult<...
function set_outlet_fact (line 395) | pub fn set_outlet_fact(&mut self, outlet: OutletId, fact: F) -> TractRes...
function with_outlet_fact (line 405) | pub fn with_outlet_fact(mut self, outlet: OutletId, fact: F) -> TractRes...
function outlet_label (line 413) | pub fn outlet_label(&self, outlet: OutletId) -> Option<&str> {
function set_outlet_label (line 418) | pub fn set_outlet_label(&mut self, outlet: OutletId, label: String) -> T...
function with_outlet_label (line 424) | pub fn with_outlet_label(mut self, outlet: OutletId, label: String) -> T...
function find_outlet_label (line 430) | pub fn find_outlet_label(&self, label: &str) -> Option<OutletId> {
function eval_order (line 437) | pub fn eval_order(&self) -> TractResult<Vec<usize>> {
function eval_order_opt_ram (line 443) | pub fn eval_order_opt_ram(&self) -> TractResult<Vec<usize>> {
function check_edges (line 449) | pub fn check_edges(&self) -> TractResult<()> {
function check_edges (line 455) | pub fn check_edges(&self) -> TractResult<()> {
function eval_tmp_memory_usage (line 486) | pub fn eval_tmp_memory_usage<Flushable>(
function check_names (line 499) | pub fn check_names(&self) -> TractResult<()> {
function check_names (line 505) | pub fn check_names(&self) -> TractResult<()> {
function into_runnable_with_options (line 519) | pub fn into_runnable_with_options(
function linear_prec (line 526) | pub fn linear_prec(&self, id: usize) -> TractResult<Option<&Node<F, O>>> {
function single_prec (line 534) | pub fn single_prec(&self, id: usize) -> TractResult<Option<&Node<F, O>>> {
function all_prec (line 541) | pub fn all_prec(&self, id: usize) -> TractResult<Option<TVec<&Node<F, O>...
function linear_succ (line 549) | pub fn linear_succ(&self, id: usize) -> TractResult<Option<&Node<F, O>>> {
function single_succ (line 560) | pub fn single_succ(&self, id: usize) -> TractResult<Option<&Node<F, O>>> {
function all_succ (line 569) | pub fn all_succ(&self, id: usize) -> TractResult<Option<TVec<&Node<F, O>...
function outlet_successors (line 583) | pub fn outlet_successors(&self, outlet: OutletId) -> &[InletId] {
function sym (line 588) | pub fn sym(&self, s: &str) -> Symbol {
function new_sym_with_prefix (line 593) | pub fn new_sym_with_prefix(&self, prefix: &str) -> Symbol {
function unique_name (line 599) | pub fn unique_name<'n>(&self, prefix: impl Into<Cow<'n, str>>) -> Cow<'n...
function fmt (line 619) | fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
function check_compact (line 692) | pub fn check_compact(&self) -> TractResult<()> {
function compact (line 726) | pub fn compact(&mut self) -> TractResult<()> {
function into_compact (line 791) | pub fn into_compact(mut self) -> TractResult<Self> {
type IntoRunnable (line 797) | pub trait IntoRunnable<F, O>
method into_runnable (line 802) | fn into_runnable(self) -> TractResult<Arc<RunnableModel<F, O>>>;
method into_runnable (line 811) | fn into_runnable(self) -> TractResult<Arc<RunnableModel<F, O>>> {
FILE: core/src/model/helpers.rs
type TypedModelHelpers (line 6) | pub trait TypedModelHelpers {
method next_node (line 7) | fn next_node(&self, node: &TypedNode) -> Option<&TypedNode>;
method previous_node (line 8) | fn previous_node(&self, node: &TypedNode) -> Option<&TypedNode>;
method previous_nodes (line 9) | fn previous_nodes(&self, node: &TypedNode) -> TVec<&TypedNode>;
method collect_const_inputs (line 10) | fn collect_const_inputs<'a>(&'a self, node: &TypedNode) -> TVec<&'a Co...
method single_prev_node_as (line 11) | fn single_prev_node_as<O: TypedOp>(&self, node: &TypedNode) -> Option<...
method matches_single_input_const (line 12) | fn matches_single_input_const(&self, node: &TypedNode, konst: f32) -> ...
method find_succ_bin_with_const (line 13) | fn find_succ_bin_with_const<B: BinMiniOp>(
method find_succ_bin_with_outlet (line 18) | fn find_succ_bin_with_outlet<B: BinMiniOp>(
method next_node (line 26) | fn next_node(&self, node: &TypedNode) -> Option<&TypedNode> {
method previous_node (line 34) | fn previous_node(&self, node: &TypedNode) -> Option<&TypedNode> {
method previous_nodes (line 41) | fn previous_nodes(&self, node: &TypedNode) -> TVec<&TypedNode> {
method collect_const_inputs (line 45) | fn collect_const_inputs<'a>(&'a self, node: &TypedNode) -> TVec<&'a Co...
method single_prev_node_as (line 55) | fn single_prev_node_as<O: TypedOp>(&self, node: &TypedNode) -> Option<...
method matches_single_input_const (line 69) | fn matches_single_input_const(&self, node: &TypedNode, konst: f32) -> ...
method find_succ_bin_with_const (line 85) | fn find_succ_bin_with_const<B: BinMiniOp>(
method find_succ_bin_with_outlet (line 95) | fn find_succ_bin_with_outlet<B: BinMiniOp>(
FILE: core/src/model/memory.rs
function eval_tmp_memory_usage (line 9) | pub fn eval_tmp_memory_usage<F, O, Flushable>(
FILE: core/src/model/node.rs
type Node (line 13) | pub struct Node<F: Fact, O> {
function fmt (line 33) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
function op (line 44) | pub fn op(&self) -> &dyn Op {
function op_as (line 49) | pub fn op_as<O: Op>(&self) -> Option<&O> {
function op_as_mut (line 54) | pub fn op_as_mut<O: Op>(&mut self) -> Option<&mut O> {
function op_is (line 59) | pub fn op_is<O: Op>(&self) -> bool {
function same_as (line 64) | pub fn same_as(&self, other: &Node<F, NodeOp>) -> bool {
type Outlet (line 71) | pub struct Outlet<F: Fact> {
function fmt (line 79) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
type OutletId (line 95) | pub struct OutletId {
method fmt (line 103) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
method from (line 109) | fn from(node: usize) -> OutletId {
method from (line 115) | fn from(pair: (usize, usize)) -> OutletId {
type InletId (line 122) | pub struct InletId {
method fmt (line 130) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
FILE: core/src/model/order.rs
function eval_order (line 10) | pub fn eval_order<F, O>(model: &super::Graph<F, O>) -> TractResult<Vec<u...
function eval_order_for_nodes (line 22) | pub fn eval_order_for_nodes<F, O>(
function build_flush_list (line 86) | pub fn build_flush_list<F, O, Flushable>(
function eval_order_opt_ram (line 117) | pub fn eval_order_opt_ram<F, O>(model: &super::Graph<F, O>) -> TractResu...
function eval_order_opt_ram_for_nodes (line 128) | pub fn eval_order_opt_ram_for_nodes<F, O>(
function simple (line 273) | fn simple() {
function diamond (line 284) | fn diamond() {
function dodge_loop (line 296) | fn dodge_loop() {
function opt_ram (line 317) | fn opt_ram() -> TractResult<()> {
FILE: core/src/model/patch.rs
type ModelPatch (line 16) | pub struct ModelPatch<F, O>
method default (line 43) | fn default() -> ModelPatch<F, O> {
type Target (line 61) | type Target = Graph<F, O>;
method deref (line 62) | fn deref(&self) -> &Graph<F, O> {
method deref_mut (line 72) | fn deref_mut(&mut self) -> &mut Graph<F, O> {
function new (line 83) | pub fn new(s: impl Into<String>) -> Self {
function push_context (line 87) | pub fn push_context(&mut self, s: impl Into<String>) {
function with_context (line 91) | pub fn with_context(mut self, s: impl Into<String>) -> Self {
function is_empty (line 96) | pub fn is_empty(&self) -> bool {
function tap_model (line 103) | pub fn tap_model(&mut self, model: &Graph<F, O>, outlet: OutletId) -> Tr...
function taps (line 116) | pub fn taps<'a>(
function shunt_outside_unchecked (line 124) | pub unsafe fn shunt_outside_unchecked(
function shunt_outside (line 134) | pub fn shunt_outside(
function obliterate (line 156) | pub fn obliterate(&mut self, node: usize) -> TractResult<()> {
function replace_single_op (line 162) | pub fn replace_single_op<IO: Into<O>>(
function fuse_with_next (line 180) | pub fn fuse_with_next<IO: Into<O>>(
function shunt_one_op (line 198) | pub fn shunt_one_op(
function rewire (line 216) | pub fn rewire(
function single_unary_op (line 239) | pub fn single_unary_op<IO: Into<O>>(
function intercept (line 248) | pub fn intercept<IO: Into<O>>(
function wire_node (line 263) | pub fn wire_node(
function apply (line 283) | pub fn apply(self, target: &mut Graph<F, O>) -> TractResult<()> {
FILE: core/src/model/rewriter.rs
type GenRewriteRule (line 5) | type GenRewriteRule<Ctx> =
type Rewriter (line 10) | pub struct Rewriter<Ctx> {
function with_rule_for (line 15) | pub fn with_rule_for<O: Op + 'static>(
function rewrite (line 30) | pub fn rewrite(&self, ctx: &Ctx, model: &mut TypedModel) -> TractResult<...
FILE: core/src/model/translator.rs
type Translate (line 7) | pub trait Translate<TI1, O1, TI2, O2>: fmt::Debug
method translate_node (line 14) | fn translate_node(
method translate_model (line 22) | fn translate_model(&self, source: &Graph<TI1, O1>) -> TractResult<Grap...
method translate_model_with_mappings (line 26) | fn translate_model_with_mappings(
type IntoTranslator (line 65) | pub struct IntoTranslator;
method translate_node (line 81) | fn translate_node(
FILE: core/src/model/typed.rs
type TypedModel (line 12) | pub type TypedModel = Graph<TypedFact, Box<dyn TypedOp>>;
method is_source (line 30) | fn is_source(op: &Box<dyn TypedOp>) -> bool {
method create_dummy (line 34) | fn create_dummy(&self) -> Box<dyn TypedOp> {
method create_source (line 38) | fn create_source(&self, fact: TypedFact) -> Box<dyn TypedOp> {
method wire_node (line 42) | fn wire_node(
method add_const (line 138) | fn add_const(
method into_optimized (line 161) | pub fn into_optimized(mut self) -> TractResult<TypedModel> {
method check_consistency (line 168) | pub fn check_consistency(&self) -> TractResult<()> {
method check_consistency (line 173) | pub fn check_consistency(&self) -> TractResult<()> {
method refresh_output_facts (line 223) | pub fn refresh_output_facts(&mut self) -> TractResult<()> {
method into_decluttered (line 237) | pub fn into_decluttered(mut self) -> TractResult<TypedModel> {
method transform (line 243) | pub fn transform(&mut self, transform: &dyn ModelTransform) -> TractRe...
method declutter (line 248) | pub fn declutter(&mut self) -> TractResult<()> {
method optimize_with_session (line 253) | pub fn optimize_with_session(&mut self, session: &mut OptimizerSession...
method concretize_dims (line 259) | pub fn concretize_dims(&self, values: &SymbolValues) -> TractResult<Ty...
method prop_consts (line 263) | pub fn prop_consts(&mut self) -> TractResult<()> {
method optimize (line 268) | pub fn optimize(&mut self) -> TractResult<()> {
method node_axes_mapping (line 272) | pub fn node_axes_mapping(&self, id: usize) -> TractResult<AxesMapping> {
method axes_mapping (line 277) | pub fn axes_mapping(&self) -> TractResult<AxesMapping> {
method compute_const_facts (line 281) | pub fn compute_const_facts(&mut self) -> TractResult<()> {
type TypedNode (line 14) | pub type TypedNode = Node<TypedFact, Box<dyn TypedOp>>;
type TypedModelPatch (line 16) | pub type TypedModelPatch = ModelPatch<TypedFact, Box<dyn TypedOp>>;
type TypedSimplePlan (line 18) | pub type TypedSimplePlan = SimplePlan<TypedFact, Box<dyn TypedOp>>;
type TypedRunnableModel (line 20) | pub type TypedRunnableModel = RunnableModel<TypedFact, Box<dyn TypedOp>>;
type TypedSimpleState (line 22) | pub type TypedSimpleState = SimpleState<TypedFact, Box<dyn TypedOp>>;
type TypedFrozenSimpleState (line 24) | pub type TypedFrozenSimpleState = FrozenSimpleState<TypedFact, Box<dyn T...
type RunnableModel (line 27) | pub type RunnableModel<F, O> = SimplePlan<F, O>;
method translate_node (line 315) | fn translate_node(
function test (line 343) | fn test() {
FILE: core/src/ops/array/broadcast.rs
type MultiBroadcastTo (line 4) | pub struct MultiBroadcastTo {
method name (line 9) | fn name(&self) -> StaticName {
method is_stateless (line 17) | fn is_stateless(&self) -> bool {
method eval_with_session (line 21) | fn eval_with_session(
method output_facts (line 33) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method concretize_dims (line 41) | fn concretize_dims(
method declutter (line 55) | fn declutter(
FILE: core/src/ops/array/concat.rs
type TypedConcat (line 9) | pub struct TypedConcat {
method offsets (line 14) | pub fn offsets(&self, inputs: &[&TypedFact]) -> TractResult<Vec<TDim>> {
method name (line 26) | fn name(&self) -> StaticName {
method info (line 30) | fn info(&self) -> TractResult<Vec<String>> {
method output_facts (line 40) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 60) | fn axes_mapping(
method change_axes (line 76) | fn change_axes(
method declutter (line 88) | fn declutter(
method slice (line 110) | fn slice(
method is_stateless (line 150) | fn is_stateless(&self) -> bool {
method eval (line 154) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
FILE: core/src/ops/array/dyn_slice.rs
type DynSlice (line 4) | pub struct DynSlice {
method suffix (line 10) | pub fn suffix(&self) -> String {
method name (line 16) | fn name(&self) -> StaticName {
method info (line 20) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 28) | fn is_stateless(&self) -> bool {
method eval_with_session (line 32) | fn eval_with_session(
method output_facts (line 60) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 67) | fn axes_mapping(
method change_axes (line 77) | fn change_axes(
method declutter (line 98) | fn declutter(
FILE: core/src/ops/array/gather.rs
type Gather (line 9) | pub struct Gather {
method new (line 23) | pub fn new(axis: usize) -> Gather {
method compute_output_shape (line 27) | pub fn compute_output_shape<D: DimLike>(
method eval_t (line 39) | fn eval_t<T: Datum>(&self, data: TValue, indices: &TValue) -> TractRes...
method eval_bq (line 96) | fn eval_bq<F: Datum>(
method eval_input_store (line 146) | fn eval_input_store<F: Datum>(
method name (line 15) | fn name(&self) -> StaticName {
method output_facts (line 180) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 211) | fn declutter(
method is_stateless (line 260) | fn is_stateless(&self) -> bool {
method eval (line 264) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
function test_should_gather_scalar_index (line 289) | fn test_should_gather_scalar_index() {
FILE: core/src/ops/array/gather_elements.rs
type GatherElements (line 5) | pub struct GatherElements {
method eval_t (line 18) | unsafe fn eval_t<T: Datum>(
method name (line 10) | fn name(&self) -> StaticName {
method output_facts (line 41) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method is_stateless (line 47) | fn is_stateless(&self) -> bool {
method eval (line 51) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
FILE: core/src/ops/array/gather_nd.rs
type GatherNd (line 5) | pub struct GatherNd {
method compute_shape (line 10) | fn compute_shape<D: DimLike>(
method eval_t (line 21) | unsafe fn eval_t<T: Datum>(
method name (line 85) | fn name(&self) -> StaticName {
method is_stateless (line 93) | fn is_stateless(&self) -> bool {
method eval (line 97) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 118) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 123) | fn declutter(
FILE: core/src/ops/array/one_hot.rs
type OneHot (line 6) | pub struct OneHot {
method eval_t (line 72) | unsafe fn eval_t<T: Datum + Clone>(
method name (line 14) | fn name(&self) -> StaticName {
method output_facts (line 22) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 28) | fn axes_mapping(
method is_stateless (line 51) | fn is_stateless(&self) -> bool {
method eval (line 55) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
FILE: core/src/ops/array/pad.rs
type PadMode (line 4) | pub enum PadMode {
method default (line 11) | fn default() -> PadMode {
type Pad (line 17) | pub struct Pad {
method eval_t (line 23) | fn eval_t<T>(&self, input_tensor: TValue) -> TractResult<TValue>
method name (line 88) | fn name(&self) -> StaticName {
method info (line 92) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 100) | fn is_stateless(&self) -> bool {
method eval (line 104) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 113) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method input_roi (line 124) | fn input_roi(
method axes_mapping (line 149) | fn axes_mapping(
method change_axes (line 163) | fn change_axes(
method declutter (line 193) | fn declutter(
FILE: core/src/ops/array/range.rs
type Range (line 10) | pub struct Range {
method make_t (line 39) | fn make_t<T: Datum + for<'a> std::ops::Add<&'a T, Output = T>>(
method make (line 59) | fn make(
method len_for_numbers (line 83) | fn len_for_numbers<T: Datum + AsPrimitive<f64>>(
method name (line 15) | fn name(&self) -> StaticName {
method is_stateless (line 23) | fn is_stateless(&self) -> bool {
method eval_with_session (line 27) | fn eval_with_session(
method declutter (line 97) | fn declutter(
method output_facts (line 121) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/array/reshape.rs
type FiniteReshape (line 5) | pub struct FiniteReshape {
method name (line 10) | fn name(&self) -> StaticName {
method info (line 14) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 22) | fn is_stateless(&self) -> bool {
method eval (line 26) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 37) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/array/scatter_elements.rs
type ScatterElements (line 6) | pub struct ScatterElements {
method eval_t (line 20) | unsafe fn eval_t<T: Datum>(
method eval_t_reduce (line 40) | unsafe fn eval_t_reduce<T: Datum + PartialOrd + std::ops::AddAssign + ...
method name (line 12) | fn name(&self) -> StaticName {
method output_facts (line 80) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method is_stateless (line 86) | fn is_stateless(&self) -> bool {
method eval (line 90) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
FILE: core/src/ops/array/scatter_nd.rs
type ScatterReduction (line 5) | pub enum ScatterReduction {
method as_str (line 15) | pub fn as_str(&self) -> &'static str {
method parse (line 25) | pub fn parse(s: &str) -> TractResult<Self> {
type ScatterNd (line 38) | pub struct ScatterNd {
method eval_t (line 51) | unsafe fn eval_t<T: Datum>(
method eval_t_reduce (line 77) | unsafe fn eval_t_reduce<T: Datum + PartialOrd + std::ops::AddAssign + ...
method name (line 43) | fn name(&self) -> StaticName {
method output_facts (line 122) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method is_stateless (line 128) | fn is_stateless(&self) -> bool {
method eval (line 132) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
FILE: core/src/ops/array/slice.rs
type Slice (line 5) | pub struct Slice {
method new (line 12) | pub fn new(axis: usize, start: impl ToDim, end: impl ToDim) -> Slice {
method suffix (line 16) | pub fn suffix(&self, name: &str) -> String {
method declutter_slice_after_slice (line 20) | pub fn declutter_slice_after_slice(
method name (line 46) | fn name(&self) -> StaticName {
method info (line 50) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 58) | fn is_stateless(&self) -> bool {
method eval_with_session (line 62) | fn eval_with_session(
function eval_slice (line 75) | fn eval_slice(input: &Tensor, axis: usize, start: usize, end: usize) -> ...
method output_facts (line 89) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method input_roi (line 102) | fn input_roi(
method axes_mapping (line 127) | fn axes_mapping(
method change_axes (line 143) | fn change_axes(
method declutter (line 166) | fn declutter(
method concretize_dims (line 181) | fn concretize_dims(
method slice (line 195) | fn slice(
FILE: core/src/ops/array/strided_slice.rs
type StridedSlice (line 4) | pub struct StridedSlice {
method must_shrink (line 35) | fn must_shrink(&self, ix: usize) -> bool {
method ignore_begin (line 38) | fn ignore_begin(&self, ix: usize) -> bool {
method ignore_end (line 41) | fn ignore_end(&self, ix: usize) -> bool {
method prepare_one_dim (line 44) | pub fn prepare_one_dim(
method wire (line 159) | fn wire(
type Dim (line 13) | pub struct Dim {
method soft_len (line 23) | pub fn soft_len(&self) -> TractResult<TDim> {
method name (line 265) | fn name(&self) -> StaticName {
method is_stateless (line 273) | fn is_stateless(&self) -> bool {
method eval (line 277) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 301) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 312) | fn declutter(
function apply (line 334) | fn apply(
function numpy_pos_stride (line 360) | fn numpy_pos_stride() {
function numpy_neg_stride (line 366) | fn numpy_neg_stride() {
function numpy_neg_stride_with_start_even (line 372) | fn numpy_neg_stride_with_start_even() {
function numpy_neg_stride_with_start_odd (line 378) | fn numpy_neg_stride_with_start_odd() {
FILE: core/src/ops/array/tile.rs
type Tile (line 7) | pub struct Tile {
method name (line 12) | fn name(&self) -> StaticName {
method info (line 16) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 24) | fn is_stateless(&self) -> bool {
method eval_with_session (line 28) | fn eval_with_session(
method concretize_dims (line 48) | fn concretize_dims(
method declutter (line 60) | fn declutter(
method output_facts (line 85) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
type DynTile (line 97) | pub struct DynTile {
method new (line 102) | pub fn new(scope: &SymbolScope, rank: usize) -> DynTile {
method name (line 110) | fn name(&self) -> StaticName {
method is_stateless (line 118) | fn is_stateless(&self) -> bool {
method eval_with_session (line 122) | fn eval_with_session(
method declutter (line 144) | fn declutter(
method output_facts (line 168) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
function eval_t (line 180) | fn eval_t<T: Datum>(data: &TValue, multipliers: &[usize]) -> TractResult...
FILE: core/src/ops/array/topk.rs
type Topk (line 9) | pub struct Topk {
method inner_loop_t (line 56) | fn inner_loop_t<T: Datum + PartialOrd>(
method name (line 16) | fn name(&self) -> StaticName {
method is_stateless (line 24) | fn is_stateless(&self) -> bool {
method eval (line 28) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 92) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/array/trilu.rs
type Trilu (line 4) | pub struct Trilu {
method name (line 9) | fn name(&self) -> StaticName {
method is_stateless (line 17) | fn is_stateless(&self) -> bool {
method eval (line 21) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 47) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/binary.rs
type BinMiniOp (line 13) | pub trait BinMiniOp:
method name (line 16) | fn name(&self) -> &'static str;
method validation (line 17) | fn validation(&self) -> Validation {
method operating_datum_type (line 20) | fn operating_datum_type(&self, a: DatumType, b: DatumType) -> TractRes...
method result_datum_type (line 23) | fn result_datum_type(&self, a: DatumType, b: DatumType) -> TractResult...
method eval_in_a (line 24) | fn eval_in_a(&self, a: &mut Tensor, b: &Tensor) -> TractResult<()>;
method eval_out_of_place (line 25) | fn eval_out_of_place(&self, c: &mut Tensor, a: &Tensor, b: &Tensor) ->...
method is_commutative (line 27) | fn is_commutative(&self) -> bool {
method neutral_element (line 30) | fn neutral_element(&self) -> Option<i64> {
method absorbing_element (line 33) | fn absorbing_element(&self) -> Option<i64> {
method maybe_eval_qbinary_as_float_op (line 38) | fn maybe_eval_qbinary_as_float_op(
method generic_eval (line 47) | fn generic_eval(&self, a: TValue, b: TValue, c_dt: DatumType) -> Tract...
method eval (line 63) | fn eval(&self, a: TValue, b: TValue, c_dt: DatumType) -> TractResult<T...
method declutter (line 67) | fn declutter(
method codegen (line 75) | fn codegen(
method cost_per_element (line 83) | fn cost_per_element(&self, dt: DatumType) -> TVec<(Cost, usize)> {
method as_linalg_binop (line 86) | fn as_linalg_binop(&self) -> Option<tract_linalg::BinOp> {
method eval_symbolic (line 92) | fn eval_symbolic(
method uniform_tdim_comparison (line 102) | fn uniform_tdim_comparison(&self, a: &TDim, b: &TDim) -> Option<TDim> {
type TypedBinOp (line 111) | pub struct TypedBinOp(pub Box<dyn BinMiniOp>, pub Option<DatumType>);
method output_datum_type (line 126) | fn output_datum_type(&self, a_dt: DatumType, b_dt: DatumType) -> Tract...
method combine_uniform_tdim (line 160) | fn combine_uniform_tdim(&self, a: &TDim, b: &TDim) -> Option<TDim> {
method combine_uniform_tdim_with_konst (line 177) | fn combine_uniform_tdim_with_konst(&self, a: &TDim, konst: &Tensor) ->...
method name (line 114) | fn name(&self) -> StaticName {
method validation (line 118) | fn validation(&self) -> Validation {
method is_stateless (line 132) | fn is_stateless(&self) -> bool {
method eval_with_session (line 136) | fn eval_with_session(
method eval (line 151) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 209) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method input_roi (line 246) | fn input_roi(
method change_axes (line 267) | fn change_axes(
method axes_mapping (line 290) | fn axes_mapping(
method cost (line 298) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
method slice (line 308) | fn slice(
method declutter (line 322) | fn declutter(
method codegen (line 348) | fn codegen(
function core_op_for_linalg_op (line 430) | fn core_op_for_linalg_op(linalg: &BinOp) -> Box<dyn BinMiniOp> {
function declutter_broadcasting_operand_1 (line 440) | fn declutter_broadcasting_operand_1(
function declutter_neutral (line 468) | fn declutter_neutral(
function declutter_absorbing (line 512) | fn declutter_absorbing(
function find_most_efficient_config (line 535) | fn find_most_efficient_config(
function gt_tdim (line 578) | pub fn gt_tdim(x: TDim, min_val: i64) -> bool {
type OptBinByScalar (line 583) | pub struct OptBinByScalar {
method check_input_shapes (line 595) | fn check_input_shapes(a_shape: &[TDim], b_shape: &[TDim]) -> bool {
method fmt (line 589) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::E...
method eq (line 609) | fn eq(&self, other: &Self) -> bool {
method name (line 616) | fn name(&self) -> StaticName {
method is_stateless (line 624) | fn is_stateless(&self) -> bool {
method eval (line 628) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 663) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method cost (line 670) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
type OptBinUnicast (line 684) | pub struct OptBinUnicast {
method check_b_alignement (line 696) | fn check_b_alignement(a_shape: &[TDim], b_shape: &[TDim]) -> bool {
method check_input_shapes (line 722) | fn check_input_shapes(a_shape: &[TDim], b_shape: &[TDim]) -> bool {
method fmt (line 690) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::E...
method eq (line 739) | fn eq(&self, other: &Self) -> bool {
method name (line 746) | fn name(&self) -> StaticName {
method is_stateless (line 754) | fn is_stateless(&self) -> bool {
method eval (line 758) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 787) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method cost (line 794) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
type OneUniformInput (line 1051) | pub(crate) struct OneUniformInput {
function one_input_is_uniform (line 1057) | pub(crate) fn one_input_is_uniform(
FILE: core/src/ops/cast.rs
function cast (line 3) | pub fn cast(to: DatumType) -> Cast {
function wire_cast (line 7) | pub fn wire_cast(
type Cast (line 29) | pub struct Cast {
method name (line 34) | fn name(&self) -> StaticName {
method is_stateless (line 42) | fn is_stateless(&self) -> bool {
method eval_with_session (line 46) | fn eval_with_session(
method output_facts (line 73) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 84) | fn declutter(
method axes_mapping (line 96) | fn axes_mapping(
method change_axes (line 104) | fn change_axes(
method slice (line 114) | fn slice(
FILE: core/src/ops/change_axes.rs
type InOut (line 14) | pub enum InOut {
method as_outlet (line 20) | pub fn as_outlet<F: Clone + Fact, O: Clone>(&self, node: &Node<F, O>) ...
method is_input (line 27) | pub fn is_input(&self) -> bool {
method is_output (line 31) | pub fn is_output(&self) -> bool {
method slot (line 35) | pub fn slot(&self) -> usize {
type AxisOp (line 46) | pub enum AxisOp {
method canonical (line 87) | pub fn canonical(&self) -> Cow<'_, AxisOp> {
method simplify (line 114) | pub fn simplify(&self) -> TVec<AxisOp> {
method transform_axis (line 149) | pub fn transform_axis(&self, axis: usize) -> Option<usize> {
method merge_incoming_change (line 187) | pub fn merge_incoming_change(
method change_shape_array (line 306) | pub fn change_shape_array<D: DimLike>(
method change_shape (line 358) | pub fn change_shape(&self, shape: &mut ShapeFact, broadcasting: bool) ...
method change_tensor (line 380) | pub fn change_tensor(&self, tensor: &mut Tensor, broadcasting: bool) -...
method change_view (line 429) | pub fn change_view<D>(&self, view: &mut ArrayViewD<D>) -> TractResult<...
method change_view_mut (line 449) | pub fn change_view_mut<D>(&self, view: &mut ArrayViewMutD<D>) -> Tract...
method recip (line 469) | pub fn recip(&self) -> AxisOp {
method is_noop (line 483) | pub fn is_noop(&self) -> bool {
method only_shape (line 491) | pub fn only_shape(&self) -> bool {
method wire_split_axis (line 498) | pub fn wire_split_axis(
method wire_collapse_axis (line 512) | pub fn wire_collapse_axis(
method required_rank (line 526) | pub fn required_rank(&self) -> usize {
method trim_left (line 535) | pub fn trim_left(&self, prefix: usize) -> TractResult<AxisOp> {
method fmt (line 54) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method eq (line 67) | fn eq(&self, other: &AxisOp) -> bool {
function wire_rank_broadcast (line 548) | pub fn wire_rank_broadcast(
function wire_with_rank_broadcast (line 568) | pub fn wire_with_rank_broadcast(
type AxisChange (line 580) | pub struct AxisChange {
type AxisChangeConsequence (line 586) | pub struct AxisChangeConsequence {
method new (line 592) | pub fn new(
method name (line 610) | fn name(&self) -> StaticName {
method info (line 619) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 636) | fn is_stateless(&self) -> bool {
method eval_with_session (line 640) | fn eval_with_session(
function remap_uniform_tdim (line 661) | fn remap_uniform_tdim(expr: &TDim, axis_op: &AxisOp) -> Option<TDim> {
method output_facts (line 707) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 733) | fn axes_mapping(
method declutter (line 756) | fn declutter(
method suggested_axis_changes (line 780) | fn suggested_axis_changes(&self) -> TractResult<TVec<(InOut, AxisOp)>> {
method change_axes (line 784) | fn change_axes(
method concretize_dims (line 828) | fn concretize_dims(
method slice (line 848) | fn slice(
method codegen (line 869) | fn codegen(
function perm_to_cycles (line 895) | fn perm_to_cycles(perm: &[usize]) -> TVec<TVec<usize>> {
function is_rotation_cycle (line 917) | fn is_rotation_cycle(cycle: &[usize]) -> Option<(usize, usize)> {
function perm_to_atoms (line 929) | fn perm_to_atoms(input: &[usize]) -> TVec<(usize, usize)> {
function perm_to_ops (line 953) | pub fn perm_to_ops(input: &[usize]) -> TVec<AxisOp> {
function compute_shape_with_tf_rules (line 957) | pub fn compute_shape_with_tf_rules(input: &[TDim], shape_spec: &[TDim]) ...
function to_axis_ops_with_tf_rules (line 1004) | pub fn to_axis_ops_with_tf_rules(
type IntoShape (line 1052) | pub struct IntoShape {
method name (line 1060) | fn name(&self) -> StaticName {
method info (line 1064) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 1072) | fn is_stateless(&self) -> bool {
method eval (line 1076) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 1085) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 1093) | fn declutter(
function test_perm_to_cycles (line 1120) | fn test_perm_to_cycles() {
function is_rotation (line 1129) | fn is_rotation() {
function test_perm_one_rotation (line 1135) | fn test_perm_one_rotation() {
function test_perm_two_rotations (line 1140) | fn test_perm_two_rotations() {
function test_perm_complex (line 1145) | fn test_perm_complex() {
function transform_op_add_0_add_0 (line 1156) | pub fn transform_op_add_0_add_0() {
function transform_op_add_0_add_1 (line 1167) | pub fn transform_op_add_0_add_1() {
function transform_op_add_1_add_0 (line 1178) | pub fn transform_op_add_1_add_0() {
function transform_op_rm_0_rm_1 (line 1189) | pub fn transform_op_rm_0_rm_1() {
function transform_op_rm_1_rm_0 (line 1200) | pub fn transform_op_rm_1_rm_0() {
function transform_op_add_0_rm_0 (line 1213) | pub fn transform_op_add_0_rm_0() {
function transform_op_add_0_rm_1 (line 1224) | pub fn transform_op_add_0_rm_1() {
function transform_op_add_1_rm_0 (line 1235) | pub fn transform_op_add_1_rm_0() {
function transform_op_rm_1_add_0 (line 1248) | pub fn transform_op_rm_1_add_0() {
function transform_op_rm_0_add_1 (line 1259) | pub fn transform_op_rm_0_add_1() {
function transform_op_mv_02_rm_2 (line 1270) | pub fn transform_op_mv_02_rm_2() {
type ComposeProblem (line 1283) | struct ComposeProblem {
method model (line 1356) | pub fn model(&self) -> TractResult<TypedModel> {
method input (line 1366) | fn input(&self) -> TractResult<Tensor> {
method check (line 1376) | fn check(&self) -> TractResult<()> {
type Parameters (line 1289) | type Parameters = TVec<usize>;
type Strategy (line 1290) | type Strategy = BoxedStrategy<AxisOp>;
method arbitrary_with (line 1291) | fn arbitrary_with(shape: TVec<usize>) -> Self::Strategy {
type Parameters (line 1328) | type Parameters = ();
type Strategy (line 1329) | type Strategy = BoxedStrategy<ComposeProblem>;
method arbitrary_with (line 1330) | fn arbitrary_with(_args: ()) -> Self::Strategy {
function add_0_rm_0 (line 1400) | fn add_0_rm_0() {
function add_0_move_01 (line 1406) | fn add_0_move_01() {
function add_0_move_01_add_1 (line 1412) | fn add_0_move_01_add_1() {
function recip_move_01 (line 1418) | fn recip_move_01() {
function recip_move_20 (line 1424) | fn recip_move_20() {
function recip_move_02 (line 1430) | fn recip_move_02() {
function add_0_add_1_move_02 (line 1436) | fn add_0_add_1_move_02() {
function add_0_add_0 (line 1442) | fn add_0_add_0() {
function add_0_add_0_move_02 (line 1448) | fn add_0_add_0_move_02() {
function add_0_add_2_move_12 (line 1454) | fn add_0_add_2_move_12() {
function add_0_add_0_move_02_rm_0 (line 1460) | fn add_0_add_0_move_02_rm_0() {
function add_0_add_0_move_20_move_20 (line 1466) | fn add_0_add_0_move_20_move_20() {
function move_01_add_0 (line 1473) | fn move_01_add_0() {
function add_0_move_02_move_02 (line 1479) | fn add_0_move_02_move_02() {
function add_0_add_2_move_20_move_12_rm_2 (line 1485) | fn add_0_add_2_move_20_move_12_rm_2() {
function move_02_move_02 (line 1494) | fn move_02_move_02() {
function rm_1_perm_10_add_0 (line 1500) | fn rm_1_perm_10_add_0() {
function add_2_move_02_move_02 (line 1506) | fn add_2_move_02_move_02() {
function move_01_move_20_move_20 (line 1512) | fn move_01_move_20_move_20() {
function reshape_axes_tracking (line 1521) | fn reshape_axes_tracking() {
function simplify_reshape (line 1530) | fn simplify_reshape() {
function compute_invalid (line 1580) | fn compute_invalid() {
function compute_with_leading_zero (line 1585) | fn compute_with_leading_zero() {
function compute_with_leading_zero_with_flatten (line 1590) | fn compute_with_leading_zero_with_flatten() {
function compute_with_trailing_zero (line 1598) | fn compute_with_trailing_zero() {
function compute_bug_1 (line 1603) | fn compute_bug_1() {
function compute_bug_2 (line 1613) | fn compute_bug_2() {
function axis_op_rm_begin (line 1624) | fn axis_op_rm_begin() {
function axis_op_rm_end (line 1629) | fn axis_op_rm_end() {
function axis_op_insert_begin (line 1634) | fn axis_op_insert_begin() {
function axis_op_insert_end (line 1639) | fn axis_op_insert_end() {
function axis_op_merge (line 1644) | fn axis_op_merge() {
function axis_op_complex (line 1652) | fn axis_op_complex() {
FILE: core/src/ops/cnn/conv/block_quant.rs
type BlockQuantIntoShape (line 6) | pub struct BlockQuantIntoShape {
method name (line 11) | fn name(&self) -> StaticName {
method is_stateless (line 18) | fn is_stateless(&self) -> bool {
method state (line 22) | fn state(
method eval (line 30) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 41) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
type SplitGroupBlockQuant (line 61) | pub struct SplitGroupBlockQuant {
method name (line 66) | fn name(&self) -> StaticName {
method is_stateless (line 74) | fn is_stateless(&self) -> bool {
method state (line 78) | fn state(
method eval (line 86) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 98) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/cnn/conv/conv.rs
type Conv (line 39) | pub struct Conv {
method input_channels (line 51) | pub fn input_channels(&self) -> usize {
method output_channels (line 55) | pub fn output_channels(&self) -> usize {
method wire_kernel_as_g_o_ihw (line 59) | pub fn wire_kernel_as_g_o_ihw(
method wire_pack_g_o_ihw (line 98) | fn wire_pack_g_o_ihw(
method wire_bias_as_non_linear (line 144) | fn wire_bias_as_non_linear(
method wire_as_quant_im2col (line 169) | pub unsafe fn wire_as_quant_im2col(
method wire_remove_group (line 292) | pub fn wire_remove_group<D: DimLike>(
method wire_as_im2col_pair (line 313) | pub unsafe fn wire_as_im2col_pair(
method mmm_output_shape (line 371) | fn mmm_output_shape<D: DimLike>(
method wire_rm_n_if_needed (line 393) | fn wire_rm_n_if_needed(
method wire_geo_reshape (line 406) | fn wire_geo_reshape<D: DimLike>(
method wire_as_lazy_im2col (line 426) | pub unsafe fn wire_as_lazy_im2col(
method compute_geo (line 516) | fn compute_geo(
method choose_impl (line 531) | fn choose_impl(
method wire_mm_weights_bias (line 582) | fn wire_mm_weights_bias(
method wire_as_depth_wise (line 640) | pub fn wire_as_depth_wise(
method declutter_stride_slice_to_downsample (line 665) | fn declutter_stride_slice_to_downsample(
method declutter_as_einsum (line 700) | fn declutter_as_einsum(
method declutter_precursor_padding (line 774) | fn declutter_precursor_padding(
method declutter_channel_arithmetic_succ (line 809) | fn declutter_channel_arithmetic_succ(
method name (line 899) | fn name(&self) -> StaticName {
method info (line 903) | fn info(&self) -> TractResult<Vec<String>> {
method validation (line 909) | fn validation(&self) -> Validation {
method is_stateless (line 917) | fn is_stateless(&self) -> bool {
method eval (line 921) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 941) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 992) | fn axes_mapping(
method declutter (line 1038) | fn declutter(
method cost (line 1059) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
method change_axes (line 1088) | fn change_axes(
method codegen (line 1184) | fn codegen(
function should_use_lazy (line 1249) | fn should_use_lazy(input_shape: &DataShape, pool_spec: &PoolSpec, group:...
function onnx_basic_convinteger (line 1263) | fn onnx_basic_convinteger() {
function valid_conv_absorbs_precursor_pad (line 1295) | fn valid_conv_absorbs_precursor_pad() -> TractResult<()> {
FILE: core/src/ops/cnn/conv/depth_wise.rs
type DepthWise (line 8) | pub struct DepthWise {
method eval_gen (line 53) | fn eval_gen<T: Datum + Copy + num_traits::Zero + ndarray::LinalgScalar>(
method name (line 15) | fn name(&self) -> StaticName {
method info (line 19) | fn info(&self) -> TractResult<Vec<String>> {
method validation (line 23) | fn validation(&self) -> Validation {
method is_stateless (line 31) | fn is_stateless(&self) -> bool {
method eval (line 35) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 62) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method cost (line 77) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
FILE: core/src/ops/cnn/conv/im2col.rs
type Im2Col (line 15) | pub struct Im2Col {
method new (line 100) | pub fn new(
method packed_shape (line 123) | fn packed_shape<D: DimLike>(
type SymbolicGeometry (line 22) | struct SymbolicGeometry {
type Param (line 58) | type Param = [usize];
method resolve (line 59) | fn resolve(&self, input_full_shape: &[usize]) -> TractResult<ConcreteG...
type ConcreteGeometry (line 31) | struct ConcreteGeometry {
function b_pack (line 43) | pub fn b_pack(&self) -> &PackedFormat {
function k (line 49) | pub fn k(&self) -> usize {
method name (line 135) | fn name(&self) -> StaticName {
method info (line 139) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 147) | fn is_stateless(&self) -> bool {
method eval (line 151) | fn eval(&self, mut inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 209) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 226) | fn declutter(
type Patcher (line 247) | enum Patcher {
method patch (line 255) | fn patch<'p, T: Copy + Datum + num_traits::Zero>(
method generic (line 284) | fn generic<'p, T: Copy + Datum>(
method valid_1d (line 316) | fn valid_1d<'p, T: Copy + Datum>(
method padded_2d (line 345) | fn padded_2d<'p, T: Copy + Datum>(
method padded_2d_invalid_x_loop (line 416) | unsafe fn padded_2d_invalid_x_loop<T: Copy + Datum>(
method padded_2d_valid_x_loop (line 427) | unsafe fn padded_2d_valid_x_loop<T: Copy + Datum>(
method valid_2d (line 440) | fn valid_2d<'p, T: Copy + Datum>(
FILE: core/src/ops/cnn/conv/lazy_im2col.rs
type LazyIm2colParams (line 10) | pub struct LazyIm2colParams {
method r (line 17) | fn r(&self) -> usize {
method precursor (line 21) | fn precursor(&self) -> WeightType {
method prepare_tensor (line 25) | fn prepare_tensor(&self, _t: &Tensor, _k_axis: usize, _mn_axis: usize) -...
method k_alignment (line 29) | fn k_alignment(&self) -> usize {
method mem_size (line 33) | fn mem_size(&self, k: TDim, mn: TDim) -> TDim {
method extract_at_mn_f16 (line 37) | fn extract_at_mn_f16(
method extract_at_mn_f32 (line 45) | fn extract_at_mn_f32(
method prepare_one (line 54) | fn prepare_one(
method fmt (line 65) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method buffer_sizes (line 71) | fn buffer_sizes(&self) -> TVec<TDim> {
type LazyIm2Col (line 81) | pub struct LazyIm2Col {
method name (line 86) | fn name(&self) -> StaticName {
method is_stateless (line 94) | fn is_stateless(&self) -> bool {
method eval (line 98) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 109) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
type LazyIm2colInput (line 122) | struct LazyIm2colInput {
method input_8n (line 143) | fn input_8n<T: Datum + Copy>(
method input_6n (line 183) | fn input_6n<T: Datum + Copy>(
method input_4n (line 217) | fn input_4n<T: Datum + Copy>(
method input_2n (line 245) | fn input_2n<T: Datum + Copy>(
method write (line 267) | fn write<T: Datum + Copy>(
method do_panel (line 397) | fn do_panel<T: Datum + Copy>(&self, i: usize, buffer: Option<*mut u8>)...
method fmt (line 128) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method hash (line 134) | fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
method scratch_panel_buffer_layout (line 364) | fn scratch_panel_buffer_layout(&self) -> Option<std::alloc::Layout> {
method panel_bytes (line 369) | fn panel_bytes(&self, i: usize, buffer: Option<*mut u8>) -> TractResult<...
method k (line 373) | fn k(&self) -> usize {
method mn (line 377) | fn mn(&self) -> usize {
method format (line 381) | fn format(&self) -> &dyn MMMInputFormat {
method exotic_fact (line 385) | fn exotic_fact(&self) -> &dyn ExoticFact {
method extract_at_mn_f16 (line 388) | fn extract_at_mn_f16(&self, _mn: usize, _slice: &mut [f16]) -> TractResu...
method extract_at_mn_f32 (line 391) | fn extract_at_mn_f32(&self, _mn: usize, _slice: &mut [f32]) -> TractResu...
FILE: core/src/ops/cnn/conv/mod.rs
type KernelFormat (line 17) | pub enum KernelFormat {
method h_axis (line 25) | pub fn h_axis(&self) -> usize {
method spatial_shape (line 33) | pub fn spatial_shape<'a, D>(&self, full_shape: &'a [D]) -> &'a [D] {
method hw (line 37) | pub fn hw<'a, D>(&self, full_shape: &'a [D]) -> &'a [D] {
method i (line 41) | pub fn i<'a, D>(&self, full_shape: &'a [D]) -> &'a D {
method o_axis (line 49) | pub fn o_axis<D>(&self, full_shape: &[D]) -> usize {
method i_axis (line 56) | pub fn i_axis<D>(&self, full_shape: &[D]) -> usize {
method o (line 64) | pub fn o<'a, D>(&self, full_shape: &'a [D]) -> &'a D {
method input_channels (line 68) | pub fn input_channels<'s, D: DimLike>(
method output_channels (line 79) | pub fn output_channels<'s, D: DimLike>(
method kernel_as_group_o_i_h_w_ops (line 92) | pub fn kernel_as_group_o_i_h_w_ops(
method kernel_as_group_o_i_hw_ops (line 135) | pub fn kernel_as_group_o_i_hw_ops(
method kernel_as_group_o_ihw_ops (line 151) | pub fn kernel_as_group_o_ihw_ops(
method kernel_as_group_o_i_hw (line 163) | pub fn kernel_as_group_o_i_hw(&self, kernel: &Tensor, group: usize) ->...
method kernel_as_group_o_ihw (line 172) | pub fn kernel_as_group_o_ihw(&self, kernel: &Tensor, group: usize) -> ...
function rewrite_kernel_conv_in_oihw (line 178) | pub fn rewrite_kernel_conv_in_oihw(
function rewrite_kernel_deconv_in_oihw (line 195) | pub fn rewrite_kernel_deconv_in_oihw(
function rewrite_kernel_in_oihw (line 212) | fn rewrite_kernel_in_oihw(
FILE: core/src/ops/cnn/conv/q_sum_b.rs
type QSumB (line 6) | pub struct QSumB {
method eval (line 52) | fn eval(&self, inputs: TVec<TValue>, n: usize) -> TractResult<TVec<TVa...
method eval_t (line 77) | fn eval_t<T: Datum + tract_num_traits::AsPrimitive<i32>>(
method name (line 14) | fn name(&self) -> StaticName {
method info (line 18) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 26) | fn is_stateless(&self) -> bool {
method eval_with_session (line 30) | fn eval_with_session(
method output_facts (line 44) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/cnn/deconv/deconv.rs
type Deconv (line 9) | pub struct Deconv {
method wire_with_deconv_sum (line 17) | fn wire_with_deconv_sum(
method name (line 127) | fn name(&self) -> StaticName {
method info (line 131) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 139) | fn is_stateless(&self) -> bool {
method eval (line 143) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 158) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 174) | fn axes_mapping(
method codegen (line 207) | fn codegen(
FILE: core/src/ops/cnn/deconv/deconv_sum.rs
type DeconvSum (line 23) | pub struct DeconvSum {
method eval_with_values (line 56) | fn eval_with_values(
method name (line 33) | fn name(&self) -> StaticName {
method is_stateless (line 41) | fn is_stateless(&self) -> bool {
method eval_with_session (line 45) | fn eval_with_session(
method output_facts (line 102) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method concretize_dims (line 109) | fn concretize_dims(
function eval (line 127) | fn eval(
FILE: core/src/ops/cnn/deconv/mod.rs
function output_shape (line 10) | pub fn output_shape<D: DimLike>(
function adjustments (line 34) | pub fn adjustments(
FILE: core/src/ops/cnn/maxpool.rs
type MaxPool (line 7) | pub struct MaxPool {
method to_optimized (line 77) | fn to_optimized(&self, input_shape: &[TDim]) -> TractResult<OptMaxPool> {
method name (line 13) | fn name(&self) -> StaticName {
method info (line 17) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 25) | fn is_stateless(&self) -> bool {
method eval (line 29) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 36) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 45) | fn declutter(
type OptMaxPool (line 87) | pub struct OptMaxPool {
method eval_t (line 131) | fn eval_t<T: Datum + Copy + num_traits::Bounded + PartialOrd>(
method name (line 94) | fn name(&self) -> StaticName {
method info (line 98) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 106) | fn is_stateless(&self) -> bool {
method eval (line 110) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 118) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/cnn/mod.rs
function wire_reshape_bias_as_vector (line 23) | pub fn wire_reshape_bias_as_vector(
function wire_reshape_bias_for_bin (line 49) | pub fn wire_reshape_bias_for_bin(
function rewrite_conv_with_n_axis (line 72) | pub fn rewrite_conv_with_n_axis(
function rewrite_deconv_with_n_axis (line 93) | pub fn rewrite_deconv_with_n_axis(
FILE: core/src/ops/cnn/padding.rs
type PaddingSpec (line 4) | pub enum PaddingSpec {
method valid_dim (line 24) | pub fn valid_dim(&self, d: usize, stride_is_one: bool) -> bool {
method change_geo_axes (line 35) | pub fn change_geo_axes(&self, op: &AxisOp) -> TractResult<PaddingSpec> {
method compute (line 63) | pub fn compute<D: DimLike>(
method compute_for_deconv (line 83) | pub fn compute_for_deconv<D: DimLike>(
method compute_one (line 105) | pub fn compute_one<D: DimLike>(
method compute_one_for_deconv (line 126) | pub fn compute_one_for_deconv<D: DimLike>(
method valid (line 149) | fn valid<D: DimLike>(
method valid_for_deconv (line 164) | fn valid_for_deconv<D: DimLike>(
method explicit (line 176) | fn explicit<D: DimLike>(
method explicit_usize (line 200) | fn explicit_usize(
method explicit_onnx_pool (line 214) | fn explicit_onnx_pool<D: DimLike>(
method explicit_onnx_pool_usize (line 242) | fn explicit_onnx_pool_usize(
method explicit_for_deconv (line 265) | fn explicit_for_deconv<D: DimLike>(
method same (line 280) | fn same<D: DimLike>(
method same_for_deconv (line 302) | fn same_for_deconv<D: DimLike>(
type ComputedPaddedDim (line 16) | pub struct ComputedPaddedDim<D: DimLike> {
function same_stride_1 (line 332) | fn same_stride_1() {
function same_stride_2 (line 340) | fn same_stride_2() {
function same_1 (line 348) | fn same_1() {
function same_lower (line 353) | fn same_lower() {
function same_ker_3 (line 358) | fn same_ker_3() {
function same_ker_3_stride_3 (line 366) | fn same_ker_3_stride_3() {
function valid_1 (line 371) | fn valid_1() {
function explicit_2 (line 376) | fn explicit_2() {
function explicit_3 (line 385) | fn explicit_3() {
function same_upper (line 393) | fn same_upper() {
function bug_explicit_stride (line 400) | fn bug_explicit_stride() {
FILE: core/src/ops/cnn/patch_axis.rs
type Region (line 7) | pub struct Region {
type PatchAxis (line 13) | pub struct PatchAxis {
method valid_range (line 24) | fn valid_range(&self) -> Option<Range<usize>> {
method invalid_at_left (line 34) | fn invalid_at_left(&self, pos: usize) -> usize {
method invalid_at_right (line 39) | fn invalid_at_right(&self, pos: usize) -> usize {
method make_invalid_regions (line 46) | fn make_invalid_regions(&self, range: Range<usize>) -> TVec<Region> {
method regions (line 65) | pub fn regions(&self) -> TVec<Region> {
function axis_5_3 (line 89) | fn axis_5_3() -> PatchAxis {
function axis_5_4 (line 94) | fn axis_5_4() -> PatchAxis {
function axis_5_5 (line 99) | fn axis_5_5() -> PatchAxis {
function axis_5_3_s2 (line 104) | fn axis_5_3_s2() -> PatchAxis {
function axis_5_3_d2 (line 109) | fn axis_5_3_d2() -> PatchAxis {
function axis_10_2_s3_valid (line 114) | fn axis_10_2_s3_valid() -> PatchAxis {
function axis_valid_ranges (line 119) | fn axis_valid_ranges() {
function axis_invalid_at_left (line 128) | fn axis_invalid_at_left() {
function axis_invalid_at_right (line 147) | fn axis_invalid_at_right() {
function axis_5_3_regions (line 162) | fn axis_5_3_regions() {
function axis_5_3_s2_regions (line 175) | fn axis_5_3_s2_regions() {
function axis_5_3_d2_regions (line 188) | fn axis_5_3_d2_regions() {
function axis_10_2_s3_valid_regions (line 201) | fn axis_10_2_s3_valid_regions() {
function axis_7_3_s2_regions (line 207) | fn axis_7_3_s2_regions() {
function axis_5_2_s2_regions (line 221) | fn axis_5_2_s2_regions() {
function axis_28_3_very_padded_regions (line 231) | fn axis_28_3_very_padded_regions() {
function axis_7_1_s2_regions (line 247) | fn axis_7_1_s2_regions() {
function axis_1_2_regions (line 254) | fn axis_1_2_regions() {
function axis_dnn_left_pad (line 261) | fn axis_dnn_left_pad() {
FILE: core/src/ops/cnn/patches.rs
type PatchSpec (line 14) | pub struct PatchSpec {
method for_full_shape (line 39) | pub fn for_full_shape(
method for_data_shape (line 47) | pub fn for_data_shape(data_shape: DataShape) -> PatchSpec {
method with_kernel_shape (line 60) | pub fn with_kernel_shape(self, kernel_shape: TVec<usize>) -> PatchSpec {
method with_dilations (line 64) | pub fn with_dilations(self, dilations: TVec<usize>) -> PatchSpec {
method with_strides (line 68) | pub fn with_strides(self, strides: TVec<usize>) -> PatchSpec {
method with_padding (line 72) | pub fn with_padding(self, padding: PaddingSpec) -> PatchSpec {
method with_output_inner_stride (line 76) | pub fn with_output_inner_stride(self, output_inner_stride: usize) -> P...
method into_patch (line 80) | pub fn into_patch(self) -> Patch {
method fmt (line 25) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Patch (line 230) | pub struct Patch {
method rank (line 257) | pub fn rank(&self) -> usize {
method is_valid (line 261) | unsafe fn is_valid(&self, coords: &[usize]) -> bool {
method valid_zone (line 278) | pub fn valid_zone(&self) -> Option<&Zone> {
method visit_output (line 283) | pub fn visit_output(&self, mut acceptor: impl FnMut(&Scanner)) {
method centers_offsets (line 294) | pub fn centers_offsets(&self) -> Vec<isize> {
method at (line 308) | pub fn at<'p>(&'p self, coords: &[usize]) -> PatchIterator<'p> {
method at_hint (line 312) | pub fn at_hint<'p>(&'p self, coords: &[usize], hint: Option<bool>) -> ...
method global_offset_for (line 339) | pub fn global_offset_for(&self, coords: &[usize], patch_index: usize) ...
method fmt (line 250) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Zone (line 349) | pub struct Zone {
method contains_output (line 360) | pub fn contains_output(&self, coords: &[usize]) -> bool {
method visit_output (line 365) | pub fn visit_output(&self, patch: &Patch, mut acceptor: impl FnMut(&Zo...
type ZoneScanner (line 375) | pub struct ZoneScanner<'p> {
function new (line 390) | pub fn new(zone: &'p Zone, patch: &'p Patch) -> ZoneScanner<'p> {
function valid_offsets_ker_in (line 415) | pub fn valid_offsets_ker_in(&self) -> impl Iterator<Item = (usize, isize...
function next_non_inner_axis (line 419) | pub unsafe fn next_non_inner_axis(&mut self) {
function reset (line 441) | pub unsafe fn reset(&mut self) {
function refresh_dependent (line 455) | fn refresh_dependent(&mut self) {
function next (line 473) | pub fn next(&mut self) {
function done (line 489) | pub fn done(&self) -> bool {
type Scanner (line 495) | pub struct Scanner<'p> {
function new (line 508) | fn new(patch: &'p Patch) -> Scanner<'p> {
function valid_count (line 525) | pub fn valid_count(&self) -> usize {
function valid_offsets (line 530) | pub fn valid_offsets(&self) -> impl Iterator<Item = isize> + '_ {
function valid_offsets_ker_in (line 535) | pub fn valid_offsets_ker_in(&self) -> impl Iterator<Item = (usize, isize...
function next (line 540) | pub fn next(&mut self) {
function done (line 597) | pub fn done(&self) -> bool {
type PatchIterator (line 603) | pub enum PatchIterator<'p> {
type Item (line 609) | type Item = Option<isize>;
method next (line 611) | fn next(&mut self) -> Option<Option<isize>> {
type FastPatchIterator (line 620) | pub struct FastPatchIterator<'p> {
type Item (line 627) | type Item = Option<isize>;
method next (line 629) | fn next(&mut self) -> Option<Option<isize>> {
type SafePatchIterator (line 643) | pub struct SafePatchIterator<'p> {
type Item (line 651) | type Item = Option<isize>;
method next (line 652) | fn next(&mut self) -> Option<Option<isize>> {
function compute_output_spatial_dim (line 682) | fn compute_output_spatial_dim(
function basic (line 701) | fn basic() {
function strides (line 706) | fn strides() {
function padding (line 711) | fn padding() {
function strides_and_padding (line 716) | fn strides_and_padding() {
function field (line 720) | fn field(kdim: &[usize], dilations: &[usize]) -> Array2<isize> {
function test_field (line 731) | fn test_field() {
function tensor (line 738) | pub fn tensor(shape: &[usize]) -> BoxedStrategy<Tensor> {
type Problem (line 747) | struct Problem {
method input_shape (line 805) | fn input_shape(&self) -> DataShape {
method output_shape (line 809) | fn output_shape(&self) -> DataShape {
method reference_sumpool (line 819) | fn reference_sumpool(&self) -> Tensor {
method check_visitor (line 851) | fn check_visitor(&self) {
method check_zone_visitor (line 868) | fn check_zone_visitor(&self) {
method check_zoning (line 887) | fn check_zoning(&self) {
type Parameters (line 754) | type Parameters = ();
type Strategy (line 755) | type Strategy = BoxedStrategy<Problem>;
method arbitrary_with (line 756) | fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
function test_visitor_1 (line 952) | fn test_visitor_1() {
function test_visitor_2 (line 964) | fn test_visitor_2() {
function test_visitor_3 (line 974) | fn test_visitor_3() {
function test_visitor_4 (line 984) | fn test_visitor_4() {
function test_zone_visitor_1 (line 997) | fn test_zone_visitor_1() {
function test_zone_visitor_2 (line 1006) | fn test_zone_visitor_2() {
FILE: core/src/ops/cnn/pools.rs
type PoolSpec (line 9) | pub struct PoolSpec {
method info (line 20) | pub fn info(&self) -> Vec<String> {
method rank (line 30) | pub fn rank(&self) -> usize {
method dilation (line 34) | pub fn dilation(&self, geo_axis: usize) -> usize {
method dilations (line 38) | pub fn dilations(&self) -> Cow<'_, [usize]> {
method stride (line 44) | pub fn stride(&self, geo_axis: usize) -> usize {
method strides (line 48) | pub fn strides(&self) -> Cow<'_, [usize]> {
method computed_padding (line 54) | pub fn computed_padding<D: DimLike>(&self, input_hw: &[D]) -> TVec<Com...
method output_shape (line 58) | pub fn output_shape<D: DimLike>(&self, input: &[D]) -> TractResult<Bas...
method output_facts (line 71) | pub fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<...
method dispose_n_axis (line 76) | pub fn dispose_n_axis(&self) -> PoolSpec {
method compute_geo (line 80) | pub fn compute_geo(&self, input_full_shape: &[TDim]) -> TractResult<Po...
method change_geo_axes (line 90) | pub fn change_geo_axes(&self, op: &AxisOp) -> TractResult<PoolSpec> {
method declutter (line 107) | pub fn declutter(&self, input: &[TDim]) -> TractResult<Option<PoolSpec...
type PoolGeometry (line 128) | pub type PoolGeometry = super::GeometryBound<SymbolicPoolGeometry, Concr...
type SymbolicPoolGeometry (line 131) | pub struct SymbolicPoolGeometry {
type Param (line 145) | type Param = [usize];
method resolve (line 146) | fn resolve(&self, input_full_shape: &[usize]) -> TractResult<ConcreteP...
type ConcretePoolGeometry (line 138) | pub struct ConcretePoolGeometry {
FILE: core/src/ops/cnn/sumpool.rs
type SumPool (line 8) | pub struct SumPool {
method to_optimized (line 67) | fn to_optimized(&self, input_shape: &[TDim]) -> TractResult<OptSumPool> {
method name (line 15) | fn name(&self) -> StaticName {
method info (line 19) | fn info(&self) -> TractResult<Vec<String>> {
method validation (line 23) | fn validation(&self) -> Validation {
method is_stateless (line 31) | fn is_stateless(&self) -> bool {
method eval (line 35) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 42) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 46) | fn declutter(
type OptSumPool (line 78) | pub struct OptSumPool {
method eval_t (line 157) | fn eval_t<T: Copy + Datum + Sum + num_traits::Float>(
method name (line 86) | fn name(&self) -> StaticName {
method info (line 90) | fn info(&self) -> TractResult<Vec<String>> {
method validation (line 94) | fn validation(&self) -> Validation {
method is_stateless (line 102) | fn is_stateless(&self) -> bool {
method eval (line 106) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 132) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 136) | fn declutter(
FILE: core/src/ops/downsample/array.rs
function pull_downsample_over_slice (line 5) | pub fn pull_downsample_over_slice(
function pull_downsample_over_axis_op (line 31) | pub fn pull_downsample_over_axis_op(
function crop_then_down_strat (line 56) | fn crop_then_down_strat() -> BoxedStrategy<(usize, usize, usize, usize, ...
function crop_then_down (line 67) | fn crop_then_down(
function crop_then_down_1 (line 118) | fn crop_then_down_1() {
function crop_then_down_2 (line 123) | fn crop_then_down_2() {
function crop_then_down_5 (line 128) | fn crop_then_down_5() {
FILE: core/src/ops/downsample/conv.rs
function fuse_downsample_into_conv (line 6) | pub fn fuse_downsample_into_conv(
FILE: core/src/ops/downsample/mod.rs
type Downsample (line 12) | pub struct Downsample {
method transform_dim (line 19) | pub(crate) fn transform_dim(&self, input_dim: &TDim) -> TDim {
method transform_fact (line 23) | pub(crate) fn transform_fact(&self, input_fact: &TypedFact) -> TractRe...
method name (line 39) | fn name(&self) -> StaticName {
method info (line 43) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 51) | fn is_stateless(&self) -> bool {
method eval (line 55) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 88) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 100) | fn declutter(
function pull_downsample_up (line 120) | fn pull_downsample_up(
FILE: core/src/ops/downsample/scan.rs
function pull_downsample_over_scan (line 7) | pub fn pull_downsample_over_scan(
FILE: core/src/ops/dummy.rs
type Dummy (line 4) | pub struct Dummy;
method name (line 7) | fn name(&self) -> StaticName {
method is_stateless (line 15) | fn is_stateless(&self) -> bool {
method eval (line 19) | fn eval(&self, _inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 27) | fn output_facts(&self, _inputs: &[&TypedFact]) -> TractResult<TVec<Typed...
FILE: core/src/ops/einsum/as_blas.rs
type AsBlas (line 10) | pub struct AsBlas;
method name (line 13) | fn name(&self) -> StaticName {
method transform (line 17) | fn transform(&self, model: &mut TypedModel) -> TractResult<()> {
function matmul_to_sgemm (line 26) | fn matmul_to_sgemm(
type SGemm (line 46) | pub struct SGemm {}
method output_shape (line 57) | fn output_shape<D: DimLike>(&self, a: &[D], b: &[D]) -> TractResult<TV...
method name (line 49) | fn name(&self) -> StaticName {
method is_stateless (line 72) | fn is_stateless(&self) -> bool {
method eval (line 76) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 159) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method cost (line 165) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
FILE: core/src/ops/einsum/einsum_matmul.rs
function merge_consecutive_same_role_axes (line 21) | pub fn merge_consecutive_same_role_axes(model: &mut TypedModel) -> Tract...
function merge_same_role_axes_rule (line 27) | fn merge_same_role_axes_rule(
function detect_all (line 327) | pub fn detect_all(model: &mut TypedModel) -> TractResult<()> {
function flatten_all (line 331) | pub fn flatten_all(model: &mut TypedModel) -> TractResult<()> {
type EinSumMatMul (line 336) | pub struct EinSumMatMul {
method m_axis (line 347) | pub fn m_axis(&self) -> &Axis {
method k_axis (line 350) | pub fn k_axis(&self) -> &Axis {
method n_axis (line 353) | pub fn n_axis(&self) -> &Axis {
method a_m (line 356) | pub fn a_m(&self) -> usize {
method a_k (line 359) | pub fn a_k(&self) -> usize {
method b_k (line 362) | pub fn b_k(&self) -> usize {
method b_n (line 365) | pub fn b_n(&self) -> usize {
method c_m (line 368) | pub fn c_m(&self) -> Option<usize> {
method c_n (line 371) | pub fn c_n(&self) -> Option<usize> {
method new (line 375) | fn new(
method fmt (line 389) | fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
type Target (line 406) | type Target = EinSum;
method deref (line 407) | fn deref(&self) -> &Self::Target {
method name (line 413) | fn name(&self) -> StaticName {
method is_stateless (line 421) | fn is_stateless(&self) -> bool {
method eval_with_session (line 424) | fn eval_with_session(
method output_facts (line 435) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method codegen (line 439) | fn codegen(
function detect_rule (line 492) | pub(crate) fn detect_rule(
function inject_k_axis (line 589) | pub(super) fn inject_k_axis(
function regroup_k_axes (line 611) | pub(super) fn regroup_k_axes(
function inject_m_or_n_axis (line 683) | pub(super) fn inject_m_or_n_axis(
function wire_axes_fix (line 708) | fn wire_axes_fix(
function dequant (line 721) | fn dequant(
function flatten_rule (line 797) | fn flatten_rule(
function optimized_mat_mul (line 807) | fn optimized_mat_mul(
FILE: core/src/ops/einsum/eval.rs
function output_shape (line 9) | pub fn output_shape<D: DimLike>(
function dequant_inputs (line 30) | pub fn dequant_inputs(acc: DatumType, input: TVec<TValue>) -> TractResul...
function eval_t (line 77) | pub fn eval_t<Acc: Datum + Zero + One>(
function eval_q (line 154) | pub fn eval_q(expr: &AxesMapping, qp: DatumType, inputs: TVec<TValue>) -...
FILE: core/src/ops/einsum/kernel_selection.rs
type Impl (line 15) | pub type Impl = (Box<dyn MatMatMul>, usize, Option<PanelExtractor>);
type Strat (line 16) | pub type Strat = (ModePicker, Box<dyn MMMInputFormat>, Vec<Impl>);
function single_strat (line 18) | fn single_strat(it: Impl) -> Strat {
function strategize (line 22) | pub fn strategize(model: &TypedModel, node: &TypedNode, op: &EinSumMatMu...
function list_impls (line 97) | pub fn list_impls(
FILE: core/src/ops/einsum/mod.rs
function block_quant_aware_input_shape (line 23) | pub fn block_quant_aware_input_shape(fact: &TypedFact) -> TractResult<Co...
type EinSum (line 46) | pub struct EinSum {
method new (line 55) | pub fn new(axes: AxesMapping, operating_dt: DatumType) -> EinSum {
method newq (line 59) | pub fn newq(axes: AxesMapping, operating_dt: DatumType, output_type: D...
method actual_input_shapes_from_facts (line 63) | pub fn actual_input_shapes_from_facts<'m>(
method propagate_axis (line 79) | pub(crate) fn propagate_axis(
method acceptable_accumulators (line 130) | pub fn acceptable_accumulators(&self) -> TVec<DatumType> {
method fmt (line 142) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method name (line 148) | fn name(&self) -> StaticName {
method info (line 152) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 164) | fn is_stateless(&self) -> bool {
method eval (line 168) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 195) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 221) | fn axes_mapping(
method cost (line 241) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
method slice (line 265) | fn slice(
method change_axes (line 290) | fn change_axes(
method declutter_with_session (line 324) | fn declutter_with_session(
method codegen (line 339) | fn codegen(
function declutter_reshape_folding_input_axis (line 354) | fn declutter_reshape_folding_input_axis(
function declutter_broadcast (line 418) | fn declutter_broadcast(
FILE: core/src/ops/einsum/prefix_matmul.rs
type EinSumToPrefixMatmulCtx (line 13) | pub struct EinSumToPrefixMatmulCtx {
function rewrite_einsum_to_prefix_matmul (line 17) | pub fn rewrite_einsum_to_prefix_matmul(
function rule (line 27) | fn rule(
function matmul_semantic_output_dt (line 159) | fn matmul_semantic_output_dt(
type PrefixMatMul (line 179) | pub struct PrefixMatMul {
method output_shape (line 188) | fn output_shape<D: DimLike + One>(&self, a: &[D], b: &[D]) -> TVec<D> {
method mm (line 201) | fn mm<Acc: Datum + tract_ndarray::LinalgScalar>(
method name (line 235) | fn name(&self) -> StaticName {
method info (line 239) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 250) | fn is_stateless(&self) -> bool {
method eval (line 254) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 296) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
function tensor (line 324) | pub fn tensor(shape: &[usize]) -> BoxedStrategy<Tensor> {
function full_shapes (line 332) | fn full_shapes(e: &AxesMapping) -> BoxedStrategy<(Vec<usize>, Vec<usize>...
function test_expr (line 354) | fn test_expr(expr: &str) -> TestCaseResult {
type EinSumProblem (line 402) | struct EinSumProblem {
method check (line 409) | fn check(&self) -> TractResult<()> {
function prop_mk_kn_mn (line 430) | fn prop_mk_kn_mn() -> TestCaseResult { test_expr("mk,kn->mn") }
function prop_km_kn_mn (line 431) | fn prop_km_kn_mn() -> TestCaseResult { test_expr("km,kn->mn") }
function prop_mk_nk_mn (line 432) | fn prop_mk_nk_mn() -> TestCaseResult { test_expr("mk,nk->mn") }
function prop_mk_kn_nm (line 433) | fn prop_mk_kn_nm() -> TestCaseResult { test_expr("mk,kn->nm") }
function prop_k_kn_mn (line 434) | fn prop_k_kn_mn() -> TestCaseResult { test_expr("k,kn->mn") }
function prop_mk_k_mn (line 435) | fn prop_mk_k_mn() -> TestCaseResult { test_expr("mk,k->mn") }
function prop_m_n_mn (line 436) | fn prop_m_n_mn() -> TestCaseResult { test_expr("m,n->mn") }
function prop_amk_akn_amn (line 437) | fn prop_amk_akn_amn() -> TestCaseResult { test_expr("amk,akn->amn") }
function prop_mk_akn_amn (line 438) | fn prop_mk_akn_amn() -> TestCaseResult { test_expr("mk,akn->amn") }
function prop_btgi_gih_tgh (line 439) | fn prop_btgi_gih_tgh() -> TestCaseResult { test_expr("btgi,gih->tgh") }
function prop_tgi_gih_btgh (line 440) | fn prop_tgi_gih_btgh() -> TestCaseResult { test_expr("tgi,gih->btgh") }
function k_kn_mn_0 (line 443) | fn k_kn_mn_0() -> TractResult<()> {
function mk_k_mn_0 (line 453) | fn mk_k_mn_0() -> TractResult<()> {
function mk_k_mn_1 (line 463) | fn mk_k_mn_1() -> TractResult<()> {
function mk_kn_nm_0 (line 473) | fn mk_kn_nm_0() -> TractResult<()> {
function amk_akn_amn_0 (line 483) | fn amk_akn_amn_0() -> TractResult<()> {
function amk_akn_amn_1 (line 493) | fn amk_akn_amn_1() -> TractResult<()> {
function amk_akn_amn_2 (line 503) | fn amk_akn_amn_2() -> TractResult<()> {
function amk_akn_amn_3 (line 513) | fn amk_akn_amn_3() -> TractResult<()> {
function km_anbck_bmn_0 (line 523) | fn km_anbck_bmn_0() -> TractResult<()> {
function q (line 533) | fn q() -> TractResult<()> {
FILE: core/src/ops/einsum/proptest.rs
type BinEinsumProblem (line 13) | struct BinEinsumProblem {
method fmt (line 23) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method check (line 96) | fn check(&self) -> TractResult<()> {
type Parameters (line 33) | type Parameters = ();
type Strategy (line 34) | type Strategy = BoxedStrategy<BinEinsumProblem>;
method arbitrary_with (line 36) | fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
function tensor (line 87) | pub fn tensor(shape: &[usize]) -> BoxedStrategy<Tensor> {
function unicast_0 (line 138) | fn unicast_0() {
function unicast_1 (line 152) | fn unicast_1() {
function unicast_2 (line 166) | fn unicast_2() {
FILE: core/src/ops/element_wise.rs
type ElementWiseMiniOp (line 6) | pub trait ElementWiseMiniOp:
method name (line 9) | fn name(&self) -> String;
method prefix (line 10) | fn prefix(&self) -> &'static str {
method validation (line 13) | fn validation(&self) -> Validation {
method output_type (line 17) | fn output_type(&self, input_type: DatumType) -> Option<DatumType> {
method eval_in_place (line 21) | fn eval_in_place(&self, t: &mut Tensor, out_dt: Option<DatumType>) -> ...
method eval_out_of_place (line 25) | fn eval_out_of_place(&self, t: &Tensor, out_dt: Option<DatumType>) -> ...
method cost_per_element (line 29) | fn cost_per_element(&self, dt: DatumType) -> TVec<(Cost, usize)> {
method operating_datum_type (line 33) | fn operating_datum_type(&self, dt: DatumType) -> DatumType {
method declutter (line 37) | fn declutter(
method quantize (line 46) | fn quantize(
method info (line 55) | fn info(&self) -> TractResult<Vec<String>> {
type ElementWiseOp (line 65) | pub struct ElementWiseOp(pub Box<dyn ElementWiseMiniOp>, pub Option<Datu...
method output_datum_type (line 68) | fn output_datum_type(&self, input_dt: DatumType) -> DatumType {
method name (line 74) | fn name(&self) -> StaticName {
method info (line 78) | fn info(&self) -> TractResult<Vec<String>> {
method validation (line 82) | fn validation(&self) -> Validation {
method is_stateless (line 90) | fn is_stateless(&self) -> bool {
method eval (line 94) | fn eval(&self, mut inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 106) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method change_axes (line 143) | fn change_axes(
method declutter (line 153) | fn declutter(
method axes_mapping (line 171) | fn axes_mapping(
method cost (line 179) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
method quantize (line 189) | fn quantize(
method slice (line 204) | fn slice(
FILE: core/src/ops/fft.rs
type Fft (line 9) | pub struct Fft {
method eval_t (line 15) | fn eval_t<T: Datum + FftNum + FromPrimitive + Float>(
method name (line 51) | fn name(&self) -> StaticName {
method info (line 55) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 63) | fn is_stateless(&self) -> bool {
method eval (line 67) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 84) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
type Stft (line 100) | pub struct Stft {
method eval_t (line 108) | fn eval_t<T: Datum + FftNum + FromPrimitive + Float>(
method name (line 182) | fn name(&self) -> StaticName {
method is_stateless (line 190) | fn is_stateless(&self) -> bool {
method eval (line 194) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 210) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/identity.rs
type Identity (line 4) | pub struct Identity;
method name (line 7) | fn name(&self) -> StaticName {
method is_stateless (line 15) | fn is_stateless(&self) -> bool {
method eval (line 20) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 26) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 30) | fn declutter(
method fuse (line 38) | fn fuse(&self, model: &TypedModel, node: &TypedNode) -> TractResult<Opti...
method axes_mapping (line 42) | fn axes_mapping(
type PinConst (line 54) | pub struct PinConst;
method name (line 57) | fn name(&self) -> StaticName {
method is_stateless (line 65) | fn is_stateless(&self) -> bool {
method eval (line 70) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method state (line 74) | fn state(
method eval (line 84) | fn eval(
method output_facts (line 95) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/konst.rs
type Const (line 4) | pub struct Const(Arc<Tensor>, Option<Box<dyn ExoticFact>>);
method new (line 7) | pub fn new(tensor: Arc<Tensor>) -> TractResult<Const> {
method new_with_exotic_fact (line 11) | pub fn new_with_exotic_fact(
method new_with_opt_exotic_fact (line 18) | pub fn new_with_opt_exotic_fact(
method val (line 26) | pub fn val(&self) -> &Arc<Tensor> {
method exotic_fact (line 30) | pub fn exotic_fact(&self) -> Option<&dyn ExoticFact> {
method name (line 36) | fn name(&self) -> StaticName {
method is_stateless (line 44) | fn is_stateless(&self) -> bool {
method eval (line 48) | fn eval(&self, _inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 56) | fn output_facts(&self, _inputs: &[&TypedFact]) -> TractResult<TVec<Typed...
method cost (line 75) | fn cost(&self, _inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
method concretize_dims (line 79) | fn concretize_dims(
method change_axes (line 99) | fn change_axes(
FILE: core/src/ops/logic.rs
function declutter_xor (line 25) | fn declutter_xor(
type Iff (line 50) | pub struct Iff;
method eval_t (line 53) | pub unsafe fn eval_t<T: Datum>(
method name (line 70) | fn name(&self) -> StaticName {
method is_stateless (line 77) | fn is_stateless(&self) -> bool {
method eval (line 81) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
function sym_to_coord_axis (line 94) | pub fn sym_to_coord_axis(sym: &Symbol) -> Option<usize> {
function coord_bound_assertions (line 98) | pub(crate) fn coord_bound_assertions(expr: &TDim, shape: &ShapeFact) -> ...
function is_provably_all_false (line 111) | pub(crate) fn is_provably_all_false(expr: &TDim, shape: &ShapeFact) -> b...
function is_provably_all_true (line 116) | pub(crate) fn is_provably_all_true(expr: &TDim, shape: &ShapeFact) -> bo...
type TrueRange (line 133) | pub(crate) struct TrueRange {
method is_full (line 141) | pub fn is_full(&self) -> bool {
method is_empty (line 145) | pub fn is_empty(&self) -> bool {
function classify_true_range (line 154) | pub(crate) fn classify_true_range(expr: &TDim, shape: &ShapeFact) -> Opt...
method output_facts (line 191) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method input_roi (line 213) | fn input_roi(
method declutter (line 228) | fn declutter(
method axes_mapping (line 246) | fn axes_mapping(
function declutter_bitxor (line 266) | fn declutter_bitxor(
function iff_fold_case1_eq_t_zero (line 306) | fn iff_fold_case1_eq_t_zero() -> TractResult<()> {
function iff_fold_case2_not_lt_x1_t (line 348) | fn iff_fold_case2_not_lt_x1_t() -> TractResult<()> {
function iff_split_to_slice_concat (line 425) | fn iff_split_to_slice_concat() -> TractResult<()> {
function verify_uniform_tdim_propagation (line 506) | fn verify_uniform_tdim_propagation() -> TractResult<()> {
FILE: core/src/ops/logic/comparison.rs
function eval_comp_oop (line 9) | fn eval_comp_oop<T: Datum + PartialOrd>(
function eval_tdim_symbolic (line 25) | fn eval_tdim_symbolic(
function prove_eq (line 137) | fn prove_eq(a: &TDim, b: &TDim) -> TractResult<bool> {
function prove_ne (line 141) | fn prove_ne(a: &TDim, b: &TDim) -> TractResult<bool> {
function prove_gte (line 145) | fn prove_gte(a: &TDim, b: &TDim) -> TractResult<bool> {
function prove_gt (line 156) | fn prove_gt(a: &TDim, b: &TDim) -> TractResult<bool> {
function prove_lte (line 167) | fn prove_lte(a: &TDim, b: &TDim) -> TractResult<bool> {
function prove_lt (line 171) | fn prove_lt(a: &TDim, b: &TDim) -> TractResult<bool> {
function comp_eq (line 200) | pub fn comp_eq() -> Box<dyn BinMiniOp> {
function comp_ne (line 203) | pub fn comp_ne() -> Box<dyn BinMiniOp> {
function comp_lt (line 206) | pub fn comp_lt() -> Box<dyn BinMiniOp> {
function comp_gt (line 209) | pub fn comp_gt() -> Box<dyn BinMiniOp> {
function comp_lte (line 212) | pub fn comp_lte() -> Box<dyn BinMiniOp> {
function comp_gte (line 215) | pub fn comp_gte() -> Box<dyn BinMiniOp> {
FILE: core/src/ops/logic/ite.rs
type IfThenElse (line 4) | pub struct IfThenElse {
method eq (line 12) | fn eq(&self, _other: &Self) -> bool {
method name (line 19) | fn name(&self) -> StaticName {
method output_facts (line 27) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 43) | fn declutter(
method is_stateless (line 86) | fn is_stateless(&self) -> bool {
method eval (line 90) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
FILE: core/src/ops/math/complex.rs
type InnerDimToComplex (line 6) | pub struct InnerDimToComplex;
method name (line 9) | fn name(&self) -> StaticName {
method is_stateless (line 17) | fn is_stateless(&self) -> bool {
method eval (line 21) | fn eval(&self, mut inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 28) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
type ComplexToInnerDim (line 42) | pub struct ComplexToInnerDim;
method name (line 45) | fn name(&self) -> StaticName {
method is_stateless (line 53) | fn is_stateless(&self) -> bool {
method eval (line 57) | fn eval(&self, mut inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 63) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/math/mod.rs
function add_quant (line 31) | fn add_quant<T>(c: &mut T, a: &T, b: &T, zp: i32, _: f32)
function sub_quant (line 55) | fn sub_quant<T>(c: &mut T, a: &T, b: &T, zp: i32, _: f32)
function subf_quant (line 63) | fn subf_quant<T>(c: &mut T, a: &T, b: &T, zp: i32, _: f32)
function declutter_mul (line 327) | fn declutter_mul(
function declutter_mul_const_mul_const (line 403) | fn declutter_mul_const_mul_const(
function declutter_div (line 436) | fn declutter_div(
function declutter_pow (line 482) | fn declutter_pow(
function declutter_square (line 542) | fn declutter_square(model: &TypedModel, node: &TypedNode) -> TractResult...
function declutter_recip (line 575) | fn declutter_recip(model: &TypedModel, node: &TypedNode) -> TractResult<...
function test_mul (line 765) | fn test_mul() {
function dot (line 772) | fn dot() {
function mul_as_shift_left (line 779) | fn mul_as_shift_left() -> TractResult<()> {
function div_as_shift (line 802) | fn div_as_shift() -> TractResult<()> {
FILE: core/src/ops/matmul/de_block_quant.rs
type BlockQuantTransform (line 9) | pub struct BlockQuantTransform;
method name (line 12) | fn name(&self) -> StaticName {
method transform (line 16) | fn transform(&self, model: &mut TypedModel) -> TractResult<()> {
function block_quant_einsum_weights (line 26) | fn block_quant_einsum_weights(
FILE: core/src/ops/matmul/mod.rs
function output_type (line 8) | pub fn output_type(input: DatumType) -> DatumType {
type ModePicker (line 13) | pub enum ModePicker {
method pick (line 20) | pub fn pick(&self, n: usize) -> TractResult<usize> {
FILE: core/src/ops/matmul/optimized.rs
type ProtoFusedSpec (line 19) | pub enum ProtoFusedSpec {
method format (line 37) | pub fn format(&self, mmm: &dyn MatMatMul, mode: usize) -> String {
method resolve (line 55) | pub fn resolve<'t>(
method is_trivial (line 129) | pub fn is_trivial(&self) -> bool {
method resolve_trivial (line 136) | pub fn resolve_trivial<'t>(
method check_inputs (line 203) | fn check_inputs(&self, inputs: &[&TypedFact]) -> TractResult<()> {
method cost (line 226) | fn cost(&self, m: &TDim, n: &TDim, idt: DatumType) -> TVec<(Cost, TDim...
method rm_c_axis (line 235) | fn rm_c_axis(&mut self, axis: usize) {
type MapOutputAxisToInput (line 267) | pub struct MapOutputAxisToInput(pub TVec<(usize, usize)>);
method translate_view (line 271) | unsafe fn translate_view(&self, output_coords: &[usize], v: &mut Tenso...
method rm_c_axis (line 278) | fn rm_c_axis(&mut self, axis: usize) {
method flat_index (line 286) | pub fn flat_index(&self, output_coords: &[usize], batch_strides: &[isi...
type AddMatMulGeometry (line 295) | pub struct AddMatMulGeometry {
type OptMatMul (line 302) | pub struct OptMatMul {
method new (line 601) | pub fn new(
method guess_k (line 631) | pub fn guess_k(&self) -> Option<TDim> {
method m (line 643) | pub fn m(&self) -> &TDim {
method n (line 648) | pub fn n(&self) -> &TDim {
method update_trivial_path (line 652) | fn update_trivial_path(&mut self) {
method can_use_trivial_path (line 656) | fn can_use_trivial_path(&self) -> bool {
method fuse_op (line 665) | fn fuse_op(
method fuse_binary (line 686) | fn fuse_binary(
method name (line 314) | fn name(&self) -> StaticName {
method info (line 318) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 343) | fn is_stateless(&self) -> bool {
method eval_with_session (line 347) | fn eval_with_session(
method output_facts (line 402) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method cost (line 413) | fn cost(&self, _inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
method fuse (line 439) | fn fuse(&self, model: &TypedModel, node: &TypedNode) -> TractResult<Opti...
FILE: core/src/ops/matmul/pack.rs
type OptMatMulPack (line 13) | pub struct OptMatMulPack {
method do_eval (line 85) | fn do_eval(&self, _session: &TurnState, input: TValue) -> TractResult<...
method output_shape (line 122) | pub fn output_shape<D: DimLike>(&self, input: &[D]) -> TVec<D> {
method name (line 21) | fn name(&self) -> StaticName {
method info (line 25) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 33) | fn is_stateless(&self) -> bool {
method eval_with_session (line 37) | fn eval_with_session(
method output_facts (line 48) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 64) | fn axes_mapping(
type DynPackedExoticFact (line 131) | pub struct DynPackedExoticFact {
method buffer_sizes (line 138) | fn buffer_sizes(&self) -> TVec<TDim> {
type OptSimpleMatMulPack (line 144) | pub struct OptSimpleMatMulPack {
method name (line 151) | fn name(&self) -> StaticName {
method is_stateless (line 158) | fn is_stateless(&self) -> bool {
method state (line 162) | fn state(
method eval (line 170) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 192) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/matmul/quant.rs
function wire_ensure_q8_flavour (line 11) | pub fn wire_ensure_q8_flavour(
function combine_scales (line 65) | pub(crate) fn combine_scales(
function compensate_zero_points (line 88) | pub(crate) fn compensate_zero_points(
function requant (line 155) | pub(crate) fn requant(
function clamp_and_cast_to (line 186) | pub(crate) fn clamp_and_cast_to(
function c0 (line 268) | fn c0() {
function b_scale (line 284) | fn b_scale() {
function sat (line 300) | fn sat() {
function rounding (line 316) | fn rounding() {
function neg_rounding (line 332) | fn neg_rounding() {
function rounding_ties_2 (line 348) | fn rounding_ties_2() {
function rounding_ties_3 (line 364) | fn rounding_ties_3() {
function onnx_test_matmulinteger (line 380) | fn onnx_test_matmulinteger() {
function round_ties_to_right (line 395) | fn round_ties_to_right(x: f32) -> i32 {
function scale (line 399) | fn scale() -> BoxedStrategy<f32> {
function test_qmmp_i8_i8_i8_0 (line 580) | fn test_qmmp_i8_i8_i8_0() {
function test_qmmp_i8_i8_i8_1 (line 596) | fn test_qmmp_i8_i8_i8_1() {
function test_qmmp_i8_i8_u8 (line 612) | fn test_qmmp_i8_i8_u8() {
function test_qmmp_i8_u8_i8 (line 628) | fn test_qmmp_i8_u8_i8() {
function test_qmmp_u8_i8_i8 (line 644) | fn test_qmmp_u8_i8_i8() {
function test_qmmp_i8_u8_u8 (line 660) | fn test_qmmp_i8_u8_u8() {
function test_qmmp_u8_i8_u8 (line 676) | fn test_qmmp_u8_i8_u8() {
function test_qmmp_u8_u8_i8 (line 692) | fn test_qmmp_u8_u8_i8() {
function test_qmmp_u8_u8_u8 (line 708) | fn test_qmmp_u8_u8_u8() {
FILE: core/src/ops/memory/force_eval.rs
type ForceEval (line 4) | pub struct ForceEval {
method new (line 9) | pub fn new(slots: Vec<usize>) -> ForceEval {
method name (line 15) | fn name(&self) -> StaticName {
method info (line 19) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 27) | fn is_stateless(&self) -> bool {
method state (line 31) | fn state(
method eval (line 39) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 61) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
FILE: core/src/ops/memory/load.rs
type Load (line 4) | pub struct Load {
method new (line 9) | pub fn new(id: &str) -> Load {
method name (line 15) | fn name(&self) -> StaticName {
method info (line 19) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 27) | fn is_stateless(&self) -> bool {
method state (line 31) | fn state(
method output_facts (line 43) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method eval (line 55) | fn eval(
FILE: core/src/ops/memory/store.rs
type Store (line 4) | pub struct Store {
method new (line 9) | pub fn new(id: &str) -> Store {
method name (line 15) | fn name(&self) -> StaticName {
method info (line 19) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 27) | fn is_stateless(&self) -> bool {
method state (line 31) | fn state(
method output_facts (line 43) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method eval (line 53) | fn eval(
FILE: core/src/ops/mod.rs
type Validation (line 45) | pub enum Validation {
type Cost (line 55) | pub enum Cost {
method is_compute (line 64) | pub fn is_compute(&self) -> bool {
method fmt (line 75) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type FrozenOpState (line 87) | pub trait FrozenOpState: fmt::Debug + dyn_clone::DynClone + Send + 'stat...
method unfreeze (line 88) | fn unfreeze(&self) -> Box<dyn OpState>;
type OpStateFreeze (line 91) | pub trait OpStateFreeze {
method freeze (line 92) | fn freeze(&self) -> Box<dyn FrozenOpState>;
type OpState (line 97) | pub trait OpState: fmt::Debug + dyn_clone::DynClone + OpStateFreeze + Do...
method load_from (line 98) | fn load_from(
method save_to (line 106) | fn save_to(&self, _: &mut Vec<TValue>) -> TractResult<()> {
method init_tensor_fact (line 110) | fn init_tensor_fact(&self) -> Option<(String, TypedFact)> {
method resolve_symbols (line 114) | fn resolve_symbols(&mut self, _: &mut TurnState) -> TractResult<()> {
method eval (line 118) | fn eval(
type EvalOp (line 128) | pub trait EvalOp {
method eval (line 130) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method eval_with_session (line 135) | fn eval_with_session(
method state (line 145) | fn state(&self, session: &TurnState, node_id: usize) -> TractResult<Op...
method is_stateless (line 149) | fn is_stateless(&self) -> bool;
type Op (line 153) | pub trait Op:
method name (line 156) | fn name(&self) -> StaticName;
method validation (line 160) | fn validation(&self) -> Validation {
method info (line 166) | fn info(&self) -> TractResult<Vec<String>> {
method as_typed (line 170) | fn as_typed(&self) -> Option<&dyn TypedOp>;
type TypedOp (line 177) | pub trait TypedOp:
method as_op (line 181) | fn as_op(&self) -> &dyn Op;
method as_op_mut (line 184) | fn as_op_mut(&mut self) -> &mut dyn Op;
method output_facts (line 187) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<Type...
method axes_mapping (line 190) | fn axes_mapping(
method fuse (line 199) | fn fuse(&self, _model: &TypedModel, _node: &TypedNode) -> TractResult<...
method declutter_with_session (line 205) | fn declutter_with_session(
method declutter (line 216) | fn declutter(
method cost (line 227) | fn cost(&self, _inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim...
method input_roi (line 236) | fn input_roi(
method suggested_axis_changes (line 245) | fn suggested_axis_changes(&self) -> TractResult<TVec<(InOut, AxisOp)>> {
method change_axes (line 250) | fn change_axes(
method slice (line 262) | fn slice(
method quantize (line 280) | fn quantize(
method concretize_dims (line 293) | fn concretize_dims(
method codegen (line 310) | fn codegen(
method nested_model_multipliers (line 320) | fn nested_model_multipliers(&self, inputs: &[&TypedFact]) -> Vec<(Stat...
function from (line 330) | fn from(it: O) -> Box<dyn Op> {
function from (line 336) | fn from(it: O) -> Box<dyn TypedOp> {
function from (line 342) | fn from(it: &'a Box<dyn TypedOp>) -> Box<dyn TypedOp> {
function as_ref (line 348) | fn as_ref(&self) -> &dyn Op {
function as_ref (line 354) | fn as_ref(&self) -> &dyn Op {
function as_mut (line 360) | fn as_mut(&mut self) -> &mut dyn Op {
function as_mut (line 366) | fn as_mut(&mut self) -> &mut dyn Op {
function fmt (line 372) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
function fmt (line 378) | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
FILE: core/src/ops/nn/data_formats.rs
type DataFormat (line 6) | pub enum DataFormat {
method dispose_n_axis (line 15) | pub fn dispose_n_axis(&self) -> DataFormat {
method shape (line 23) | pub fn shape<D, S>(&self, shape: S) -> TractResult<BaseDataShape<D, S>>
method from_n_c_hw (line 37) | pub fn from_n_c_hw<D, S>(&self, n: D, c: D, shape: S) -> TractResult<B...
method has_n (line 56) | pub fn has_n(&self) -> bool {
method c_is_last (line 60) | pub fn c_is_last(&self) -> bool {
method h_axis (line 64) | pub fn h_axis(&self) -> usize {
method with_n (line 68) | pub fn with_n(&self) -> DataFormat {
type SymDataShape (line 77) | pub type SymDataShape = BaseDataShape<TDim, TVec<TDim>>;
type DataShape (line 78) | pub type DataShape = BaseDataShape<usize, TVec<usize>>;
type BaseDataShape (line 81) | pub struct BaseDataShape<D, S>
function fmt (line 96) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function rank (line 113) | pub fn rank(&self) -> usize {
function hw_rank (line 118) | pub fn hw_rank(&self) -> usize {
function n_axis (line 123) | pub fn n_axis(&self) -> Option<usize> {
function c_axis (line 131) | pub fn c_axis(&self) -> usize {
function h_axis (line 140) | pub fn h_axis(&self) -> usize {
function hw_axes (line 149) | pub fn hw_axes(&self) -> ::std::ops::Range<usize> {
function n_dim (line 154) | pub fn n_dim(&self) -> Option<&D> {
function c_dim (line 159) | pub fn c_dim(&self) -> &D {
function hw_dims (line 164) | pub fn hw_dims(&self) -> &[D] {
function n (line 169) | pub fn n(&self) -> Option<&D> {
function c (line 174) | pub fn c(&self) -> &D {
function n_stride (line 179) | pub fn n_stride(&self) -> Option<&D> {
function h_stride (line 184) | pub fn h_stride(&self) -> &D {
function hw_strides (line 189) | pub fn hw_strides(&self) -> &[D] {
function w_stride (line 194) | pub fn w_stride(&self) -> &D {
function c_stride (line 199) | pub fn c_stride(&self) -> &D {
FILE: core/src/ops/nn/gelu_approximate.rs
function gelu_approx_f32 (line 8) | fn gelu_approx_f32(x: f32, pow: i32) -> f32 {
function detect_gelu_approx (line 32) | pub fn detect_gelu_approx(
FILE: core/src/ops/nn/reduce.rs
type Reducer (line 52) | pub enum Reducer {
method reduce (line 65) | pub fn reduce(&self, axes: &[usize], input: &Tensor) -> TractResult<Te...
method reduce_t (line 115) | unsafe fn reduce_t<T, TO, F, A>(
method sum (line 149) | unsafe fn sum<T>(&self, axes: &[usize], input: &Tensor) -> Tensor
method mean_of_squares (line 249) | fn mean_of_squares(&self, axis: &[usize], input: &Tensor) -> TractResu...
function argmax_t (line 260) | fn argmax_t<T>(v: ArrayViewD<T>, last: bool) -> i64
function argmin_t (line 276) | fn argmin_t<T>(v: ArrayViewD<T>, last: bool) -> i64
function max_t (line 292) | fn max_t<T>(v: ArrayViewD<T>, _: ()) -> T
function min_t (line 305) | fn min_t<T>(v: ArrayViewD<T>, _: ()) -> T
function prod_t (line 312) | fn prod_t<T>(v: ArrayViewD<T>, _: ()) -> T
function q_prod_t (line 319) | fn q_prod_t<T>(v: ArrayViewD<T>, zp_scale: (i32, f32)) -> T
function q_sum_t (line 330) | fn q_sum_t<T>(v: ArrayViewD<T>, zp_scale: (i32, f32)) -> T
function all_bool (line 339) | fn all_bool(v: ArrayViewD<bool>, _: ()) -> bool {
function any_bool (line 343) | fn any_bool(v: ArrayViewD<bool>, _: ()) -> bool {
type Reduce (line 348) | pub struct Reduce {
method declutter_reduce_reduce (line 490) | fn declutter_reduce_reduce(
method declutter_scalar_mul_then_sum (line 521) | fn declutter_scalar_mul_then_sum(
method declutter_mean_of_square (line 547) | fn declutter_mean_of_square(
method name (line 354) | fn name(&self) -> StaticName {
method info (line 357) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 364) | fn is_stateless(&self) -> bool {
method eval (line 368) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 374) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method declutter (line 391) | fn declutter(
method cost (line 411) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
method axes_mapping (line 426) | fn axes_mapping(
method change_axes (line 454) | fn change_axes(
method slice (line 471) | fn slice(
function expand_mean_of_squares (line 584) | pub fn expand_mean_of_squares(
FILE: core/src/ops/nn/rms_norm.rs
type RmsNorm (line 9) | pub struct RmsNorm {
method name (line 15) | fn name(&self) -> StaticName {
method info (line 18) | fn info(&self) -> TractResult<Vec<String>> {
method is_stateless (line 25) | fn is_stateless(&self) -> bool {
method eval (line 29) | fn eval(&self, inputs: TVec<TValue>) -> TractResult<TVec<TValue>> {
method output_facts (line 42) | fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedF...
method axes_mapping (line 55) | fn axes_mapping(
method change_axes (line 70) | fn change_axes(
method slice (line 85) | fn slice(
method cost (line 102) | fn cost(&self, inputs: &[&TypedFact]) -> TractResult<TVec<(Cost, TDim)>> {
function detect_rms_norm (line 121) | pub fn detect_rms_norm(
FILE: core/src/ops/nn/silu.rs
function detect_silu (line 27) | pub fn detect_silu(model: &TypedModel, node: &TypedNode) -> TractResult<...
FILE: core/src/ops/nn/softmax/fixedpoint.rs
type Q0_31 (line 23) | pub type Q0_31 = FixedPoint<i32, 0>;
type Q1_30 (line 24) | pub type Q1_30 = FixedPoint<i32, 1>;
type Q2_29 (line 25) | pub type Q2_29 = FixedPoint<i32, 2>;
type Q5_26 (line 26) | pub type Q5_26 = FixedPoint<i32, 5>;
type FixedPoint (line 29) | pub struct FixedPoint<T: PrimInt, const INTEGER_BITS: usize>(T);
function from_raw (line 35) | pub fn from_raw(x: T) -> Self {
function one (line 39) | pub fn one() -> Self {
function fractional_bits (line 47) | pub fn fractional_bits() -> usize {
function zero (line 56) | pub fn zero() -> Self {
function as_raw (line 60) | pub fn as_raw(&self) -> T {
function is_signed (line 64) | pub fn is_signed() -> bool {
function constant_pot (line 74) | pub fn constant_pot(exponent: isize) -> Self {
function exp_on_negative_values (line 88) | pub fn exp_on_negative_values(&self) -> FixedPoint<i32, 0> {
function saturating_rounding_multiply_by_pot (line 98) | pub fn saturating_rounding_multiply_by_pot(&self, exponent: i32) -> Self {
function rounding_divide_by_pot (line 103) | pub fn rounding_divide_by_pot(&self, exponent: i32) -> Self {
function select_using_mask (line 107) | pub fn select_using_mask(mask: i32, a: Self, b: Self) -> Self {
function rescale (line 111) | pub fn rescale<const DST_INTEGER_BITS: usize>(&self) -> FixedPoint<i32, ...
function get_reciprocal (line 120) | pub fn get_reciprocal(&self) -> (FixedPoint<i32, 0>, usize) {
method fmt (line 131) | fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
function as_f32 (line 140) | pub fn as_f32(&self) -> f32 {
function from_f32 (line 151) | pub fn from_f32(x: f32) -> Self {
type Output (line 166) | type Output = FixedPoint<T, INTEGER_BITS>;
function add (line 167) | fn add(self, rhs: Self) -> Self::Output {
type Output (line 173) | type Output = FixedPoint<T, INTEGER_BITS>;
function sub (line 174) | fn sub(self, rhs: Self) -> Self::Output {
type Output (line 180) | type Output = FixedPoint<T, INTEGER_BITS>;
function shl (line 181) | fn shl(self, rhs: usize) -> Self::Output {
type Output (line 187) | type Output = FixedPoint<T, INTEGER_BITS>;
function shr (line 188) | fn shr(self, rhs: usize) -> Self::Output {
type Output (line 194) | type Output = FixedPoint<T, INTEGER_BITS>;
function bitand (line 195) | fn bitand(self, rhs: Self) -> Self::Output {
type Q10_21 (line 223) | pub type Q10_21 = FixedPoint<i32, 10>;
type Q12_19 (line 224) | pub type Q12_19 = FixedPoint<i32, 12>;
type Q26_5 (line 225) | pub type Q26_5 = FixedPoint<i32, 26>;
type Q0_7 (line 226) | type Q0_7 = FixedPoint<i8, 0>;
function test_to_f32 (line 229) | fn test_to_f32() {
function test_to_f32_1 (line 235) | fn test_to_f32_1() {
function test_one (line 241) | fn test_one() {
function test_one_limit (line 247) | fn test_one_limit() {
function test_mul_1 (line 253) | fn test_mul_1() {
function test_add (line 263) | fn test_add() {
function test_one_over_one_plus_x_for_x_in_0_1 (line 272) | fn test_one_over_one_plus_x_for_x_in_0_1() {
function test_one_over_one_plus_x_for_x_in_0_1_1 (line 280) | fn test_one_over_one_plus_x_for_x_in_0_1_1() {
function test_get_reciprocal_1 (line 288) | fn test_get_reciprocal_1() {
function test_get_reciprocal_2 (line 298) | fn test_get_reciprocal_2() {
function test_get_reciprocal_3 (line 308) | fn test_get_reciprocal_3() {
function test_rescale_1 (line 318) | fn test_rescale_1() {
function test_exp_on_interval_between_negative_one_quarter_and_0_excl (line 326) | fn test_exp_on_interval_between_negative_one_quarter_and_0_excl() {
function test_exp_on_negative_values_1 (line 334) | fn test_exp_on_negative_values_1() {
function test_exp_on_negative_values_2 (line 342) | fn test_exp_on_negative_values_2() {
function test_exp_on_negative_values_3 (line 350) | fn test_exp_on_negative_values_3() {
function test_exp_on_negative_values_4 (line 358) | fn test_exp_on_negative_values_4() {
FILE: core/src/ops/nn/softmax/math.rs
function convert_scale_to_mult_shift (line 6) | pub fn convert_scale_to_mult_shift(scale: f32) -> Option<(i32, isize)> {
function get_reciprocal (line 33) | pub
Copy disabled (too large)
Download .json
Condensed preview — 1571 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (11,177K chars).
[
{
"path": ".all_crates.sh",
"chars": 201,
"preview": "\nALL_CRATES_PATH=\"data linalg core nnef nnef/nnef-resources pulse-opl pulse extra transformers hir tflite tensorflow onn"
},
{
"path": ".change_crate_dep.sh",
"chars": 190,
"preview": "#!/bin/bash\n\ncrate=$1\nversion=$2\n\nperl -pi -e \"s/^($crate = {.*version *= *)\\\"([^\\\"]*)\\\"(.*)$/\\$1\\\"=$version\\\"\\$3/\" \\\n "
},
{
"path": ".clang-format",
"chars": 179,
"preview": "BasedOnStyle: LLVM\nIndentWidth: 4\nTabWidth: 4\nUseTab: Never\nIndentPPDirectives: BeforeHash\nPPIndentWidth: 4\nColumnLimit:"
},
{
"path": ".github/dependabot.yml",
"chars": 652,
"preview": "version: 2\nupdates:\n - package-ecosystem: \"github-actions\"\n directory: \"/\"\n schedule:\n interval: \"weekly\"\n "
},
{
"path": ".github/workflows/asan.yml",
"chars": 475,
"preview": "name: Sanitized build tests\n\non:\n workflow_dispatch:\n schedule:\n - cron: '0 5 * * MON'\n\nenv:\n CARGO_INCREMENTAL: "
},
{
"path": ".github/workflows/binaries.yml",
"chars": 2595,
"preview": "on:\n release:\n types:\n - created\n\nname: Upload Release Binaries\n\nenv:\n CARGO_INCREMENTAL: false\n FORCE_JAVASC"
},
{
"path": ".github/workflows/cost_model.yml",
"chars": 817,
"preview": "\non:\n workflow_dispatch:\n inputs:\n dataset_id:\n description: 'dataset identifier'\n required: true"
},
{
"path": ".github/workflows/crates.yml",
"chars": 3473,
"preview": "name: Rust crates\n\non:\n pull_request:\n schedule:\n - cron: '0 3 * * *'\n workflow_dispatch:\n\nenv:\n CARGO_INCREMENT"
},
{
"path": ".github/workflows/cross-platform.yml",
"chars": 2651,
"preview": "name: Embedded targets\n\non:\n pull_request:\n schedule:\n - cron: '0 5 * * *'\n workflow_dispatch:\n\nenv:\n CARGO_INCR"
},
{
"path": ".github/workflows/examples.yml",
"chars": 3221,
"preview": "name: Examples\n\non:\n schedule:\n - cron: '0 3 * * *'\n workflow_dispatch:\n\nenv:\n CARGO_INCREMENTAL: false\n FORCE_J"
},
{
"path": ".github/workflows/full.yml",
"chars": 4976,
"preview": "name: Full test harness\n\non:\n schedule:\n - cron: '0 3 * * *'\n workflow_dispatch:\n inputs:\n pr_number:\n "
},
{
"path": ".github/workflows/large_models.yml",
"chars": 3988,
"preview": "name: Large models\n\non:\n pull_request:\n schedule:\n - cron: '0 3 * * *'\n workflow_dispatch:\n\nenv:\n LARGE_MODELS: "
},
{
"path": ".github/workflows/pydoc.yml",
"chars": 2618,
"preview": "name: Python gh-pages doc\n\non:\n pull_request:\n release:\n workflow_dispatch:\n\nenv:\n CARGO_INCREMENTAL: false\n\njobs:\n "
},
{
"path": ".github/workflows/release.yml",
"chars": 621,
"preview": "on:\n push:\n tags:\n - 'v*'\n\nname: Create release\n\nenv:\n CARGO_INCREMENTAL: false\n FORCE_JAVASCRIPT_ACTIONS_TO_NO"
},
{
"path": ".github/workflows/tract-ci-bench.yml",
"chars": 542,
"preview": "name: Bench with tract-ci-minion\n\non:\n schedule:\n - cron: '1 * * * *' # every hour at minute 1\n workflow_dispatch:"
},
{
"path": ".github/workflows/wheels.yml",
"chars": 2372,
"preview": "name: Python wheels\n\non:\n schedule:\n - cron: '0 3 * * MON'\n release:\n types: [created]\n workflow_dispatch:\n "
},
{
"path": ".github/workflows/windows.yml",
"chars": 2030,
"preview": "name: Windows unit tests\n\non:\n# pull_request:\n workflow_dispatch:\n schedule:\n - cron: '0 3 * * *'\n\n\nenv:\n CARGO_"
},
{
"path": ".gitignore",
"chars": 237,
"preview": "target\n**/*.rs.bk\n*.rustfmt\n*.back\nCargo.lock\nexamples/data\n.idea\n.cached/**\nflamegraph.svg\nperf.data*\nreadings.*\nmetric"
},
{
"path": ".travis/README.md",
"chars": 2193,
"preview": "# Travis & minions test infrastructure\n\n## Principles\n\n* travis is triggered on each commit, it will run `./.travis/nati"
},
{
"path": ".travis/android-ndk.sh",
"chars": 761,
"preview": "#!/bin/sh\n\nset -ex\n\nwhich java || sudo apt install -y default-jdk\n\nANDROID_SDK=$HOME/cached/android-sdk\nif [ ! -d \"$ANDR"
},
{
"path": ".travis/asan.sh",
"chars": 838,
"preview": "#!/bin/sh\n\nset -ex\n\n# RUSTFLAGS=-Zsanitizer=address cargo +nightly test -Zbuild-std --target $(rustc -vV | sed -n 's|hos"
},
{
"path": ".travis/bundle-entrypoint.sh",
"chars": 9244,
"preview": "#!/bin/sh\n\nset -ex\n\nstart=$(date +%s)\n\nROOT=`pwd`\n\nif [ -n \"$TRACT_RUN\" ]\nthen\n TRACT=$TRACT_RUN\nelif [ -x tract ]\nth"
},
{
"path": ".travis/cache_file.sh",
"chars": 403,
"preview": "#!/bin/sh\n\nset -e\n\nif [ -z \"$CACHEDIR\" ]\nthen\n CACHEDIR=`dirname $0`/../.cached\nfi\n\nmkdir -p $CACHEDIR\ncd $CACHEDIR\nf"
},
{
"path": ".travis/cargo-deny-check.sh",
"chars": 138,
"preview": "#!/bin/sh\n\nif [ -e cargo-deny ]\nthen\n CARGO_DENY=`pwd`/cargo-deny\nelse\n CARGO_DENY=\"cargo deny\"\nfi\n\n(cd api/rs ; $"
},
{
"path": ".travis/ci-system-setup.sh",
"chars": 2273,
"preview": "#!/bin/sh\nset -e\n\n[ -d $ROOT/.travis ] || exit 1 \"\\$ROOT not set correctly '$ROOT'\"\n\nif [ -z \"$RUSTUP_TOOLCHAIN\" ]\nthen\n"
},
{
"path": ".travis/cli-tests.sh",
"chars": 4035,
"preview": "#!/bin/sh\n\nWHITE='\\033[1;37m'\nNC='\\033[0m' # No Color\n\nset -e\n\nROOT=$(dirname $(dirname $(realpath $0)))\n. $ROOT/.travis"
},
{
"path": ".travis/cost_model_task_build.sh",
"chars": 1894,
"preview": "#!/bin/sh\n\nset -ex\n\nARCH=$1\nID=$2\n\ncase $ARCH in\n aarch64)\n MUSL_TRIPLE=aarch64-linux-musl\n RUST_TRIPLE"
},
{
"path": ".travis/cross.sh",
"chars": 9389,
"preview": "#!/bin/sh\n\nset -ex\n\nROOT=$(dirname $(dirname $(realpath $0)))\n. $ROOT/.travis/ci-system-setup.sh\n\nwhich cargo-dinghy || "
},
{
"path": ".travis/debug-tests.sh",
"chars": 225,
"preview": "#!/bin/sh\n\nset -ex\n\nif [ -z \"$CACHEDIR\" ]\nthen\n CACHEDIR=`dirname $0`/../.cached\nfi\n\n# useful as debug_asserts will c"
},
{
"path": ".travis/docker-debian-stretch/Dockerfile",
"chars": 60,
"preview": "FROM debian:stretch\nCOPY sources.list /etc/apt/sources.list\n"
},
{
"path": ".travis/docker-debian-stretch/sources.list",
"chars": 195,
"preview": "deb http://archive.debian.org/debian/ stretch contrib main non-free\ndeb http://archive.debian.org/debian stretch-backpor"
},
{
"path": ".travis/examples.sh",
"chars": 371,
"preview": "#!/bin/sh\n\nWHITE='\\033[1;37m'\nNC='\\033[0m' # No Color\n\nset -e\n\nROOT=$(dirname $(dirname $(realpath $0)))\n. $ROOT/.travis"
},
{
"path": ".travis/llm-expectations-541",
"chars": 8843,
"preview": "Qwen--Qwen3-1.7B-f16f16.p0s100.arm64.cpu 0.96\nQwen--Qwen3-1.7B-f16f16.p0s100.arm64.metal 0.96\nQwen--Qwen3-1.7B-f16f16.p0"
},
{
"path": ".travis/make_bundle.sh",
"chars": 1363,
"preview": "#!/bin/sh\n\nset -ex\n\nTRAVIS_COMMIT=${GITHUB_SHA:-dummy-commit-id}\nBRANCH=$(echo $GITHUB_HEAD_REF | tr '/' '_')\nBRANCH=${B"
},
{
"path": ".travis/minion.sh",
"chars": 1320,
"preview": "#!/bin/bash\n\nset -ex\n. $HOME/.minionrc\n\nexec 200>$LOCKFILE || exit 1\nflock -n 200 || { echo \"WARN: flock() failed.\" >&2;"
},
{
"path": ".travis/minionrc",
"chars": 291,
"preview": "MINION_ID=\nLOCKFILE=/tmp/minion-lock\nPLATFORM=raspbian\nGRAPHITE_HOST=graphite-proxy.snips.net\nGRAPHITE_PORT=2003\nGRAPHIT"
},
{
"path": ".travis/native.sh",
"chars": 569,
"preview": "#!/bin/sh\n\nset -ex\n\nif [ -z \"$RUSTUP_TOOLCHAIN\" ]\nthen\n export RUSTUP_TOOLCHAIN=1.91.0\nfi\n\nrustup update\n\ncargo updat"
},
{
"path": ".travis/onnx-tests.sh",
"chars": 325,
"preview": "#!/bin/sh\n\nset -ex\n\nROOT=$(dirname $(realpath $0))/..\n. $ROOT/.travis/ci-system-setup.sh\n\nopset=onnx_\"${1:-1_13_0}\"\n\ncar"
},
{
"path": ".travis/regular-tests.sh",
"chars": 164,
"preview": "#!/bin/sh\n\nset -e\nset -x\n\ncd $(dirname $0)\n\n./test-published-crates.sh\nif [ -n \"$CI\" ]\nthen\n cargo clean\nfi\n./test-rt"
},
{
"path": ".travis/run-bundle.sh",
"chars": 161,
"preview": "#!/bin/sh\n\nset -ex\n\nBUNDLE_NAME=$1\n\ntar zxf $BUNDLE_NAME.tgz\n(\n cd $BUNDLE_NAME\n . ./vars\n ./entrypoint.sh\n)\n# "
},
{
"path": ".travis/run_all.sh",
"chars": 124,
"preview": "#!/bin/sh\n\nset -ex\n\n`dirname $0`/native.sh\ncd `dirname $0`/../examples\nfor i in *\ndo\n (cd $i; cargo test --release)\nd"
},
{
"path": ".travis/setup-sccache.sh",
"chars": 835,
"preview": "#!/bin/sh\n\nset -ex\n\nexport SCCACHE_DIR=$HOME/.cache/sccache\nexport SCCACHE_CACHE_SIZE=2G\n\nif [ -n \"$GITHUB_ENV\" ]\nthen\n "
},
{
"path": ".travis/test-harness.sh",
"chars": 848,
"preview": "#!/bin/sh\n\nWHITE='\\033[1;37m'\nNC='\\033[0m' # No Color\n\nif [ -e /proc/cpuinfo ]\nthen\n grep \"^flags\" /proc/cpuinfo | he"
},
{
"path": ".travis/test-llm.sh",
"chars": 4696,
"preview": "#!/bin/bash\n\nset -e\nset -o pipefail\n\nexport LC_ALL=C\n\nROOT=$(dirname $(dirname $(realpath $0)))\n. $ROOT/.travis/ci-syste"
},
{
"path": ".travis/test-published-crates.sh",
"chars": 1263,
"preview": "#!/bin/sh\n\nWHITE='\\033[1;37m'\nNC='\\033[0m' # No Color\n\nif [ -e /proc/cpuinfo ]\nthen\n grep \"^flags\" /proc/cpuinfo | he"
},
{
"path": ".travis/test-rt.sh",
"chars": 1112,
"preview": "#!/bin/sh\n\nWHITE='\\033[1;37m'\nNC='\\033[0m' # No Color\n\nif [ -e /proc/cpuinfo ]\nthen\n grep \"^flags\" /proc/cpuinfo | he"
},
{
"path": ".travis/tf.sh",
"chars": 146,
"preview": "#!/bin/sh\n\nset -ex\n\nif [ -z \"$CACHEDIR\" ]\nthen\n CACHEDIR=`dirname $0`/../.cached\nfi\n\n\n(cd tensorflow; cargo test --re"
},
{
"path": ".travis/tflite/Dockerfile.tensorflow-aarch64",
"chars": 351,
"preview": "# vim: set syntax=Dockerfile:\n\nFROM tensorflow/tensorflow:devel\n\nRUN apt-get update ; apt-get upgrade -y\nRUN apt-get ins"
},
{
"path": ".travis/tflite/Dockerfile.tensorflow-official-rpi",
"chars": 248,
"preview": "# vim: set syntax=Dockerfile:\n\nFROM tensorflow/tensorflow:nightly-devel\n\nRUN apt-get update ; apt-get upgrade -y\nRUN apt"
},
{
"path": ".travis/tflite/Dockerfile.tensorflow-rpitools",
"chars": 359,
"preview": "# vim: set syntax=Dockerfile:\n\nFROM tensorflow/tensorflow:nightly-devel\n\nRUN apt-get update ; apt-get upgrade -y\nRUN apt"
},
{
"path": ".travis/tflite/build_tflite_aarch64.sh",
"chars": 615,
"preview": "#!/bin/sh\n\nset -ex\nmkdir -p result\n\ndocker build -f Dockerfile.tensorflow-aarch64 --tag tensorflow-aarch64 .\ndocker run "
},
{
"path": ".travis/tflite/build_tflite_raspbian.sh",
"chars": 1036,
"preview": "#!/bin/sh\n\nset -ex\nmkdir -p result\n\n# build pseudo-rpi official tensorflow, https://www.tensorflow.org/lite/rpi, only wo"
},
{
"path": ".travis/tflite/convert_all.sh",
"chars": 1661,
"preview": "\nrun_in_tf_docker() {\n docker run --rm -v $HOME/.cache:/models -it tensorflow/tensorflow:nightly-devel sh -c \"$@\"\n}\n\n"
},
{
"path": ".travis/tflite/linux_makefile.inc",
"chars": 347,
"preview": "# Settings for Linux.\nifeq ($(TARGET), linux)\n CXXFLAGS += \\\n -fPIC \\\n -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \\\n "
},
{
"path": ".travis/tflite/run_all.sh",
"chars": 76,
"preview": "#!/bin/sh\n\n./benchmark_model --graph=inception_v3_2016_08_28_frozen.tflite\n\n"
},
{
"path": ".travis/tflite.sh",
"chars": 292,
"preview": "#!/bin/sh\n\nset -ex\n\nROOT=$(dirname $(dirname $(realpath $0)))\n. $ROOT/.travis/ci-system-setup.sh\n\nif [ `uname` = \"Darwin"
},
{
"path": ".travis/travis.sh",
"chars": 94,
"preview": "#!/bin/sh\n\nset -ex\n\nif [ -z \"$PLATFORM\" ]\nthen\n .travis/native.sh\nelse\n .travis/cross.sh\nfi\n"
},
{
"path": ".travis.yml",
"chars": 4222,
"preview": "language: rust\ndist: trusty\ncache:\n # - cargo\n #- directories:\n #- $HOME/cached\naddons:\n apt:\n packages:\n - aw"
},
{
"path": ".vim/coc-settings.json",
"chars": 60,
"preview": "{\n \"rust-analyzer.imports.granularity.group\": \"module\"\n}\n"
},
{
"path": "CHANGELOG.md",
"chars": 23851,
"preview": "# Unreleased\n\n* [Breaking][MSRV] MSRV bumped to 1.91.0 (for `const TypeId::of`).\n\n# 0.23.0-dev.3 — 2026-03-20\n\n### Break"
},
{
"path": "Cargo.toml",
"chars": 6826,
"preview": "[workspace]\nresolver = \"2\"\nmembers = [\n \"data\",\n \"linalg\",\n \"core\",\n \"pulse\",\n \"pulse-opl\",\n \"hir\",\n "
},
{
"path": "LICENSE",
"chars": 495,
"preview": "## License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apac"
},
{
"path": "LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "LICENSE-MIT",
"chars": 1023,
"preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
},
{
"path": "README.md",
"chars": 11168,
"preview": "\n\n or http://www.apac"
},
{
"path": "api/LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "api/LICENSE-MIT",
"chars": 1023,
"preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
},
{
"path": "api/c/.gitignore",
"chars": 52,
"preview": "*.h\n*.so\nmobilenet\nmobilenet_v2_1.0.onnx.nnef.tgz\n\n\n"
},
{
"path": "api/c/Makefile",
"chars": 498,
"preview": "run: mobilenet mobilenet_v2_1.0.onnx.nnef.tgz\n\tLD_LIBRARY_PATH=. ./mobilenet\n\nclean:\n\trm -f mobilenet libtract.so tract."
},
{
"path": "api/c/mobilenet.c",
"chars": 3017,
"preview": "#include \"tract.h\"\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#define check(call) "
},
{
"path": "api/ffi/Cargo.toml",
"chars": 736,
"preview": "[package]\nname = \"tract-ffi\"\nversion = \"0.23.0-pre\"\nlicense = \"MIT OR Apache-2.0\"\nauthors = [\"Mathieu Poumeyrol <kali@zo"
},
{
"path": "api/ffi/cbindgen.toml",
"chars": 727,
"preview": "language = \"C\"\n\nafter_includes = \"\"\"\n typedef enum DatumType {\n TRACT_DATUM_TYPE_BOOL = 1,\n TRACT_DATUM_TYP"
},
{
"path": "api/ffi/src/lib.rs",
"chars": 40567,
"preview": "#![allow(clippy::missing_safety_doc)]\n\nuse anyhow::{Context, Result};\nuse std::cell::RefCell;\nuse std::ffi::{CStr, CStri"
},
{
"path": "api/generate-tract-h.sh",
"chars": 101,
"preview": "#!/bin/sh\n\nset -ex\n\ncargo install cbindgen\n\ncbindgen ffi > tract.h\ncp tract.h c\nmv tract.h proxy/sys\n"
},
{
"path": "api/proxy/Cargo.toml",
"chars": 730,
"preview": "[package]\nname = \"tract-proxy\"\nversion = \"0.23.0-pre\"\nlicense = \"MIT OR Apache-2.0\"\nauthors = [\"Mathieu Poumeyrol <kali@"
},
{
"path": "api/proxy/LICENSE",
"chars": 495,
"preview": "## License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apac"
},
{
"path": "api/proxy/LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "api/proxy/LICENSE-MIT",
"chars": 1023,
"preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
},
{
"path": "api/proxy/ci.sh",
"chars": 376,
"preview": "#!/bin/sh\n\nROOT=$(dirname $(realpath $0))/../..\n\nset -ex\n\ncargo build --release -p tract-ffi $CARGO_EXTRA\nSO=$(cargo bui"
},
{
"path": "api/proxy/src/lib.rs",
"chars": 21759,
"preview": "use std::ffi::{CStr, CString};\nuse std::path::Path;\nuse std::ptr::{null, null_mut};\n\nuse tract_api::*;\nuse tract_proxy_s"
},
{
"path": "api/proxy/sys/Cargo.toml",
"chars": 506,
"preview": "[package]\nname = \"tract-proxy-sys\"\nversion = \"0.23.0-pre\"\nlicense = \"MIT OR Apache-2.0\"\nauthors = [\"Mathieu Poumeyrol <k"
},
{
"path": "api/proxy/sys/build.rs",
"chars": 704,
"preview": "use std::env;\nuse std::path::PathBuf;\n\nfn main() {\n println!(\"cargo:rerun-if-env-changed=TRACT_DYLIB_SEARCH_PATH\");\n "
},
{
"path": "api/proxy/sys/src/lib.rs",
"chars": 314,
"preview": "#![allow(non_upper_case_globals)]\n#![allow(non_camel_case_types)]\n#![allow(non_snake_case)]\n#![allow(improper_ctypes)]\n#"
},
{
"path": "api/proxy/sys/tract.h",
"chars": 23362,
"preview": "#include <stdarg.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n typedef enum DatumType {\n TRAC"
},
{
"path": "api/proxy/tests/mobilenet.rs",
"chars": 81,
"preview": "use tract_api::*;\nuse tract_proxy::*;\n\ninclude!(\"../../tests/mobilenet/mod.rs\");\n"
},
{
"path": "api/py/.gitignore",
"chars": 93,
"preview": "__pycache__\n*.so\n*.egg-info\n*.onnx\nbuild\nmobilenet_v2_1.0.onnx.nnef.tgz\nrust-workspace\ndist\n\n"
},
{
"path": "api/py/MANIFEST.in",
"chars": 32,
"preview": "graft rust-workspace\ngraft docs\n"
},
{
"path": "api/py/_static/redirect-index.html",
"chars": 256,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"refresh\" content=\"0; url=docs/index.html\">\n <script>window.location.h"
},
{
"path": "api/py/_static/version-switcher.js",
"chars": 2234,
"preview": "// Version switcher for multi-version gh-pages docs.\n// Reads versions.json (mike-compatible format) from the site root "
},
{
"path": "api/py/conf.py",
"chars": 526,
"preview": "project = \"tract-python\"\ncopyright = \"Sonos\"\nauthor = \"Sonos\"\n\nextensions = [\n \"sphinx.ext.autodoc\",\n \"sphinx.ext."
},
{
"path": "api/py/docs/fact.md",
"chars": 122,
"preview": "# Facts and Dimensions\n\n```{eval-rst}\n.. automodule:: tract.fact\n :members:\n\n.. automodule:: tract.dim\n :members:\n``"
},
{
"path": "api/py/docs/index.md",
"chars": 9562,
"preview": "# `tract` python bindings\n\n`tract` is a library for neural network inference. While PyTorch and TensorFlow\ndeal with the"
},
{
"path": "api/py/docs/inference_model.md",
"chars": 88,
"preview": "# Inference model\n\n```{eval-rst}\n.. automodule:: tract.inference_model\n :members:\n```\n"
},
{
"path": "api/py/docs/model.md",
"chars": 86,
"preview": "# Model (aka Typed Model)\n\n```{eval-rst}\n.. automodule:: tract.model\n :members:\n```\n"
},
{
"path": "api/py/docs/nnef.md",
"chars": 66,
"preview": "# NNEF\n\n```{eval-rst}\n.. automodule:: tract.nnef\n :members:\n```\n"
},
{
"path": "api/py/docs/onnx.md",
"chars": 66,
"preview": "# ONNX\n\n```{eval-rst}\n.. automodule:: tract.onnx\n :members:\n```\n"
},
{
"path": "api/py/docs/runnable.md",
"chars": 307,
"preview": "# Runtime, Runnable and State\n\n## Runtime\n\n```{eval-rst}\n.. autofunction:: tract.runtime.runtime_for_name\n\n.. autoclass:"
},
{
"path": "api/py/docs/tensor.md",
"chars": 70,
"preview": "# Tensor\n\n```{eval-rst}\n.. automodule:: tract.tensor\n :members:\n```\n"
},
{
"path": "api/py/pyproject.toml",
"chars": 1291,
"preview": "[build-system]\nrequires = [\n \"setuptools >=80, <83\",\n \"setuptools_rust >=1.12, <1.13\",\n \"wheel >=0.46, <0.47\",\n"
},
{
"path": "api/py/requirements-docs.txt",
"chars": 24,
"preview": "sphinx\nfuro\nmyst-parser\n"
},
{
"path": "api/py/requirements.txt",
"chars": 70,
"preview": "numpy==1.26.4\nsetuptools==82.0.1\nsetuptools_rust==1.12.1\ntoml==0.10.2\n"
},
{
"path": "api/py/setup.py",
"chars": 2436,
"preview": "from setuptools import setup\nfrom setuptools_rust import Binding, RustExtension\nimport shutil\nimport toml\nimport re\nimpo"
},
{
"path": "api/py/tests/mobilenet_onnx_test.py",
"chars": 12500,
"preview": "import tract\nimport numpy\nimport urllib.request\nimport tempfile\nimport json\nimport pytest\nfrom pathlib import Path\n\ndef "
},
{
"path": "api/py/tract/__init__.py",
"chars": 2252,
"preview": "\"\"\"\n`tract` Python bindings library\n\n`tract` is a neural network inference engine.\nIts main purpose is to *run* a neural"
},
{
"path": "api/py/tract/bindings.py",
"chars": 644,
"preview": "from ctypes import *\nfrom pathlib import Path\n\nclass TractError(Exception):\n pass\n\nif len(list(Path(__file__).parent."
},
{
"path": "api/py/tract/dim.py",
"chars": 1870,
"preview": "from ctypes import *\nfrom tract.bindings import TractError, check, lib\nfrom typing import Dict\n\nclass Dim:\n \"\"\"\n A"
},
{
"path": "api/py/tract/fact.py",
"chars": 2731,
"preview": "from ctypes import *\nfrom tract.bindings import TractError, check, lib\nfrom .dim import Dim\n\nclass InferenceFact:\n \"\""
},
{
"path": "api/py/tract/inference_model.py",
"chars": 5476,
"preview": "from ctypes import *\nfrom typing import Dict, List, Union\nfrom .bindings import TractError, check, lib\nfrom .fact import"
},
{
"path": "api/py/tract/model.py",
"chars": 6262,
"preview": "import numpy\nfrom ctypes import *\nfrom typing import Dict, List, Union\nfrom .bindings import TractError, check, lib\nfrom"
},
{
"path": "api/py/tract/nnef.py",
"chars": 4610,
"preview": "from ctypes import *\nfrom pathlib import Path\nfrom typing import Dict, List, Union\nfrom .bindings import TractError, che"
},
{
"path": "api/py/tract/onnx.py",
"chars": 1582,
"preview": "from ctypes import *\nfrom pathlib import Path\nfrom typing import Dict, List, Union\nfrom .bindings import check, lib\nfrom"
},
{
"path": "api/py/tract/runnable.py",
"chars": 4623,
"preview": "from ctypes import *\nfrom typing import Dict, List, Union # after ctypes so that Union is overriden\nimport numpy\nfrom .f"
},
{
"path": "api/py/tract/runtime.py",
"chars": 1954,
"preview": "from ctypes import *\nfrom typing import Dict, List, Union # after ctypes so that Union is overriden\nimport numpy\nfrom .r"
},
{
"path": "api/py/tract/state.py",
"chars": 3191,
"preview": "import numpy\nfrom ctypes import *\nfrom typing import List, Union\nfrom .bindings import TractError, check, lib\nfrom .fact"
},
{
"path": "api/py/tract/tensor.py",
"chars": 5469,
"preview": "import numpy\nimport math\nfrom ctypes import *\nfrom typing import Dict, List, Union\nfrom tract.bindings import TractError"
},
{
"path": "api/py/tract/transform.py",
"chars": 3786,
"preview": "import json\nfrom abc import ABC, abstractmethod\nfrom typing import Dict, Optional, Union\n\nfrom .tensor import DatumType\n"
},
{
"path": "api/rs/Cargo.toml",
"chars": 1326,
"preview": "[package]\nname = \"tract\"\nversion = \"0.23.0-pre\"\nlicense = \"MIT OR Apache-2.0\"\nauthors = [\"Mathieu Poumeyrol <kali@zoy.or"
},
{
"path": "api/rs/LICENSE",
"chars": 495,
"preview": "## License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apac"
},
{
"path": "api/rs/LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "api/rs/LICENSE-MIT",
"chars": 1023,
"preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
},
{
"path": "api/rs/src/lib.rs",
"chars": 20496,
"preview": "#[cfg(target_vendor = \"apple\")]\nextern crate tract_metal;\n\n#[cfg(any(target_os = \"linux\", target_os = \"windows\"))]\nexter"
},
{
"path": "api/rs/tests/mobilenet.rs",
"chars": 66,
"preview": "use tract::prelude::*;\n\ninclude!(\"../../tests/mobilenet/mod.rs\");\n"
},
{
"path": "api/src/lib.rs",
"chars": 15289,
"preview": "use anyhow::{Result, ensure};\nuse boow::Bow;\nuse std::fmt::{Debug, Display};\nuse std::path::Path;\n\n#[macro_use]\npub mod "
},
{
"path": "api/src/macros.rs",
"chars": 2650,
"preview": "#[macro_export]\nmacro_rules! as_inference_fact_impl {\n ($IM:ident, $IF: ident) => {\n impl AsFact<$IM, $IF> for"
},
{
"path": "api/src/transform.rs",
"chars": 5411,
"preview": "use std::collections::HashMap;\n\nuse crate::DatumType;\n\n/// A serialized transform specification passed to `ModelInterfac"
},
{
"path": "api/tests/mobilenet/mod.rs",
"chars": 15166,
"preview": "use std::sync::Once;\n\nfn grace_hopper() -> Tensor {\n let data = std::fs::read(\"../tests/grace_hopper_3_224_224.f32.ra"
},
{
"path": "ci/tract-ci-minion/.gitignore",
"chars": 12,
"preview": "minion.toml\n"
},
{
"path": "ci/tract-ci-minion/Cargo.toml",
"chars": 536,
"preview": "[package]\nname = \"tract-ci-minion\"\nversion = \"0.20.7-pre\"\nedition = \"2024\"\n\n[workspace]\nmembers = []\n\n[dependencies]\ncla"
},
{
"path": "ci/tract-ci-minion/minion.toml.example",
"chars": 429,
"preview": "id = \"tsar\"\nworkdir = \"tmp/workdir\"\nplatform = \"test\"\ngraphite = { host = \"...\", port = 2003, prefix = \"tract\" }\n\n# MINI"
},
{
"path": "ci/tract-ci-minion/src/main.rs",
"chars": 13805,
"preview": "use anyhow::{bail, Context, Result};\nuse clap::Parser;\nuse flate2::read::GzEncoder;\nuse fs2::FileExt;\nuse s3::creds::Cre"
},
{
"path": "cli/Cargo.toml",
"chars": 2886,
"preview": "[package]\nname = \"tract-cli\"\nversion = \"0.23.0-pre\"\nauthors = [\n \"Romain Liautaud <romain.liautaud@snips.ai>\",\n \"Mathi"
},
{
"path": "cli/LICENSE",
"chars": 495,
"preview": "## License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apac"
},
{
"path": "cli/LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "cli/LICENSE-MIT",
"chars": 1023,
"preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
},
{
"path": "cli/src/bench.rs",
"chars": 1824,
"preview": "use crate::Parameters;\nuse tract_hir::internal::*;\nuse tract_libcli::profile::{BenchLimits, run_one_step};\nuse tract_lib"
},
{
"path": "cli/src/compare.rs",
"chars": 24058,
"preview": "#![allow(dead_code)]\nuse std::fmt::{Debug, Display};\n#[allow(unused_imports)]\nuse std::fs;\n\nuse nu_ansi_term::Color::*;\n"
},
{
"path": "cli/src/cost.rs",
"chars": 738,
"preview": "use crate::TractResult;\nuse tract_hir::internal::*;\n\npub fn parse_costs(spec: &str) -> TractResult<Vec<(Cost, usize)>> {"
},
{
"path": "cli/src/dump.rs",
"chars": 23762,
"preview": "use crate::Parameters;\nuse crate::params::SomeGraphDef;\nuse crate::plan_options::plan_options_from_subcommand;\nuse crate"
},
{
"path": "cli/src/hwbench.rs",
"chars": 5775,
"preview": "use nu_ansi_term::Color::*;\nuse tract_core::prelude::*;\nuse tract_core::tract_data::itertools::Itertools;\nuse tract_libc"
},
{
"path": "cli/src/llm.rs",
"chars": 5534,
"preview": "use crate::Parameters;\nuse float_ord::FloatOrd;\nuse readings_probe::Probe;\nuse std::time::{Duration, Instant};\nuse tract"
},
{
"path": "cli/src/macros.rs",
"chars": 1147,
"preview": "#[macro_export]\nmacro_rules! dispatch_model {\n ($model: expr, $expr: expr) => {\n (|model: &Arc<dyn Model>| {\n "
},
{
"path": "cli/src/main.rs",
"chars": 38412,
"preview": "#![allow(clippy::len_zero)]\n#![allow(clippy::redundant_closure_call)]\n#![allow(clippy::collapsible_if)]\n#[macro_use]\next"
},
{
"path": "cli/src/memory_arena.rs",
"chars": 4261,
"preview": "use serde::{Deserialize, Serialize};\nuse std::collections::BTreeMap;\nuse tract_gpu::memory::DeviceMemSchema;\nuse tract_h"
},
{
"path": "cli/src/model.rs",
"chars": 1,
"preview": "\n"
},
{
"path": "cli/src/params.rs",
"chars": 51243,
"preview": "use fs_err as fs;\nuse reqwest::Url;\nuse scan_fmt::scan_fmt;\nuse std::io::Cursor;\nuse std::io::Read;\nuse std::path::PathB"
},
{
"path": "cli/src/plan_options.rs",
"chars": 391,
"preview": "use tract_core::internal::*;\n\npub fn plan_options_from_subcommand(sub_matches: &clap::ArgMatches) -> TractResult<RunOpti"
},
{
"path": "cli/src/run.rs",
"chars": 15662,
"preview": "use fs::File;\nuse std::fmt::{Debug, Display};\nuse std::path::PathBuf;\nuse std::str::FromStr;\n\nuse crate::TractResult;\nus"
},
{
"path": "cli/src/runtimes.rs",
"chars": 560,
"preview": "use tract_core::internal::*;\n\n#[derive(Default, Debug, Copy, Clone)]\npub struct UnoptimizedRuntime;\n\nregister_runtime!(U"
},
{
"path": "cli/src/tensor.rs",
"chars": 3440,
"preview": "use tract_core::internal::*;\nuse tract_libcli::tensor::RunParams;\n#[cfg(feature = \"transformers\")]\nuse tract_transformer"
},
{
"path": "cli/src/utils.rs",
"chars": 6316,
"preview": "use std::iter::once;\n\nuse crate::params::Parameters;\nuse tract_hir::internal::*;\nuse tract_itertools::Itertools;\nuse tra"
},
{
"path": "core/Cargo.toml",
"chars": 2106,
"preview": "[package]\nname = \"tract-core\"\nversion = \"0.23.0-pre\"\nlicense = \"MIT OR Apache-2.0\"\nauthors = [\"Mathieu Poumeyrol <kali@z"
},
{
"path": "core/LICENSE",
"chars": 495,
"preview": "## License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apac"
},
{
"path": "core/LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "core/LICENSE-MIT",
"chars": 1023,
"preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
},
{
"path": "core/src/axes/mapping.rs",
"chars": 30438,
"preview": "use std::fmt::Display;\nuse std::str::FromStr;\n\nuse tract_data::itertools::izip;\nuse tract_ndarray::{ArrayViewD, ArrayVie"
},
{
"path": "core/src/axes/mod.rs",
"chars": 2092,
"preview": "use crate::internal::*;\n\nmod mapping;\nmod model;\n\npub use mapping::AxesMapping;\npub use model::{for_model, full_axis_tra"
},
{
"path": "core/src/axes/model.rs",
"chars": 7334,
"preview": "use crate::internal::*;\n\n#[derive(Debug, Clone, Default)]\npub struct OutletMap<T>(Vec<TVec<Option<T>>>);\n\nimpl<T: Clone>"
},
{
"path": "core/src/broadcast.rs",
"chars": 1624,
"preview": "//! N-way tensor broadcast\nuse tract_data::internal::*;\n\n/// Computes a shape, if any, to which all shapes can be broadc"
},
{
"path": "core/src/floats.rs",
"chars": 12858,
"preview": "use crate::internal::translator::Translate;\nuse crate::internal::*;\nuse crate::ops::array::{Pad, PadMode};\nuse crate::op"
},
{
"path": "core/src/framework.rs",
"chars": 1896,
"preview": "//! Enforce consistent API between the implemented Frameworks importers.\nuse crate::internal::*;\nuse std::fmt::Debug;\nus"
},
{
"path": "core/src/late_bind.rs",
"chars": 1469,
"preview": "use crate::prelude::TractResult;\nuse std::borrow::Cow;\n\npub trait ResolveTo<Concrete> {\n type Param: ?Sized;\n fn r"
},
{
"path": "core/src/lib.rs",
"chars": 4421,
"preview": "#![allow(clippy::len_zero)]\n#![allow(clippy::missing_safety_doc)]\n#![allow(clippy::redundant_closure_call)]\n//! # Tract\n"
},
{
"path": "core/src/macros.rs",
"chars": 128,
"preview": "#[macro_export]\nmacro_rules! dims {\n ($($dim:expr),*) => {\n ShapeFact::from(&[$(TDim::from($dim.clone())),*])\n"
},
{
"path": "core/src/model/fact.rs",
"chars": 15307,
"preview": "//! Partial and complete tensor types representations.\nuse crate::internal::*;\nuse downcast_rs::Downcast;\nuse dyn_eq::Dy"
},
{
"path": "core/src/model/graph.rs",
"chars": 27865,
"preview": "use super::*;\nuse crate::internal::*;\nuse crate::ops::Op;\nuse crate::prelude::*;\nuse crate::runtime::RunOptions;\n\nuse st"
},
{
"path": "core/src/model/helpers.rs",
"chars": 3584,
"preview": "use crate::ops::binary::{BinMiniOp, TypedBinOp};\nuse crate::ops::konst::Const;\nuse crate::prelude::*;\nuse tract_data::in"
},
{
"path": "core/src/model/memory.rs",
"chars": 2117,
"preview": "use super::*;\nuse crate::prelude::*;\nuse std::collections::HashSet;\nuse std::fmt::Debug;\nuse std::fmt::Display;\nuse trac"
},
{
"path": "core/src/model/mod.rs",
"chars": 2369,
"preview": "//! ## Models and their lifecycle\n//!\n//! In order to reason on the model and performs optimisations, a model needs\n//! "
},
{
"path": "core/src/model/node.rs",
"chars": 3736,
"preview": "use super::*;\nuse crate::internal::*;\nuse crate::ops::Op;\nuse std::fmt;\nuse std::fmt::{Debug, Display};\nuse tract_iterto"
},
{
"path": "core/src/model/order.rs",
"chars": 12300,
"preview": "//! Evaluation order for nodes.\nuse crate::internal::*;\nuse bit_set::BitSet;\nuse std::collections::VecDeque;\nuse std::fm"
},
{
"path": "core/src/model/patch.rs",
"chars": 14704,
"preview": "use std::collections::HashSet;\nuse std::fmt::{Debug, Display};\nuse std::ops::{Deref, DerefMut};\n\nuse tract_data::itertoo"
},
{
"path": "core/src/model/rewriter.rs",
"chars": 2240,
"preview": "use std::any::TypeId;\n\nuse crate::internal::*;\n\ntype GenRewriteRule<Ctx> =\n Box<dyn Fn(&Ctx, &TypedModel, &TypedNode)"
},
{
"path": "core/src/model/translator.rs",
"chars": 4613,
"preview": "use crate::internal::*;\nuse crate::model::{Fact, Graph, OutletId};\nuse std::collections::HashMap;\nuse std::convert::*;\nu"
},
{
"path": "core/src/model/typed.rs",
"chars": 12978,
"preview": "use crate::internal::*;\nuse crate::model::*;\nuse crate::ops;\nuse crate::ops::konst::Const;\nuse crate::optim::OptimizerSe"
},
{
"path": "core/src/ops/array/broadcast.rs",
"chars": 1876,
"preview": "use crate::internal::*;\n\n#[derive(Debug, Clone, new, Hash, PartialEq, Eq)]\npub struct MultiBroadcastTo {\n pub shape: "
},
{
"path": "core/src/ops/array/concat.rs",
"chars": 4725,
"preview": "use tract_data::itertools::Itertools;\nuse tract_num_traits::Zero;\n\nuse crate::internal::*;\n\nuse super::Slice;\n\n#[derive("
},
{
"path": "core/src/ops/array/dyn_slice.rs",
"chars": 3263,
"preview": "use crate::internal::*;\n\n#[derive(Debug, Clone, PartialEq, Eq, Hash, new)]\npub struct DynSlice {\n pub axis: usize,\n "
},
{
"path": "core/src/ops/array/gather.rs",
"chars": 12065,
"preview": "use crate::internal::*;\nuse crate::ops::einsum::block_quant_aware_input_shape;\nuse crate::ops::matmul::pack::OptSimpleMa"
},
{
"path": "core/src/ops/array/gather_elements.rs",
"chars": 1723,
"preview": "use crate::internal::*;\nuse ndarray::*;\n\n#[derive(Debug, Clone, new, Hash, PartialEq, Eq)]\npub struct GatherElements {\n "
},
{
"path": "core/src/ops/array/gather_nd.rs",
"chars": 5410,
"preview": "use crate::internal::*;\nuse tract_ndarray::prelude::*;\n\n#[derive(Debug, Clone, new, Hash, PartialEq, Eq)]\npub struct Gat"
},
{
"path": "core/src/ops/array/mod.rs",
"chars": 916,
"preview": "/// # Operators on array and shapes\nmod broadcast;\npub(crate) mod concat;\npub mod dyn_slice;\nmod gather;\nmod gather_elem"
},
{
"path": "core/src/ops/array/one_hot.rs",
"chars": 2893,
"preview": "use tract_data::itertools::Itertools;\n\nuse crate::internal::*;\n\n#[derive(Debug, PartialEq, Eq, Clone, Hash)]\npub struct "
},
{
"path": "core/src/ops/array/pad.rs",
"chars": 6792,
"preview": "use crate::internal::*;\n\n#[derive(Debug, Clone, PartialEq, Eq, Hash)]\npub enum PadMode {\n Constant(Arc<Tensor>),\n "
},
{
"path": "core/src/ops/array/range.rs",
"chars": 6213,
"preview": "use crate::ops::cast::Cast;\nuse tract_num_traits::AsPrimitive;\nuse tract_num_traits::Zero;\n\nuse crate::internal::*;\n\nuse"
},
{
"path": "core/src/ops/array/reshape.rs",
"chars": 993,
"preview": "use crate::internal::*;\nuse tract_itertools::Itertools;\n\n#[derive(Debug, Clone, new, Default, Hash, PartialEq, Eq)]\npub "
},
{
"path": "core/src/ops/array/scatter_elements.rs",
"chars": 3941,
"preview": "use super::scatter_nd::ScatterReduction;\nuse crate::internal::*;\nuse ndarray::*;\n\n#[derive(Debug, Clone, new, Hash, Part"
},
{
"path": "core/src/ops/array/scatter_nd.rs",
"chars": 5225,
"preview": "use crate::internal::*;\nuse ndarray::*;\n\n#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Default)]\npub enum ScatterRed"
},
{
"path": "core/src/ops/array/slice.rs",
"chars": 6574,
"preview": "use crate::internal::*;\nuse crate::num_traits::Zero;\n\n#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)]\npub struct S"
},
{
"path": "core/src/ops/array/strided_slice.rs",
"chars": 13199,
"preview": "use crate::internal::*;\n\n#[derive(Debug, Clone, Hash, PartialEq, Eq)]\npub struct StridedSlice {\n pub optional_axes_in"
},
{
"path": "core/src/ops/array/tile.rs",
"chars": 5615,
"preview": "use crate::internal::*;\nuse ndarray::*;\n\nuse super::MultiBroadcastTo;\n\n#[derive(Debug, Clone, new, Default, Hash, Partia"
},
{
"path": "core/src/ops/array/topk.rs",
"chars": 3488,
"preview": "use std::cmp::Ordering;\n\nuse tract_data::itertools::Itertools;\nuse tract_ndarray::{ArrayViewMutD, Axis, Dimension};\n\nuse"
},
{
"path": "core/src/ops/array/trilu.rs",
"chars": 1515,
"preview": "use crate::internal::*;\n\n#[derive(Debug, Clone, PartialEq, Eq)]\npub struct Trilu {\n pub upper: bool,\n}\n\nimpl Op for T"
},
{
"path": "core/src/ops/binary.rs",
"chars": 40800,
"preview": "use crate::internal::*;\nuse crate::ndarray::Dimension;\nuse downcast_rs::Downcast;\nuse dyn_eq::DynEq;\nuse std::fmt::{self"
},
{
"path": "core/src/ops/cast.rs",
"chars": 3550,
"preview": "use crate::internal::*;\n\npub fn cast(to: DatumType) -> Cast {\n Cast { to }\n}\n\npub fn wire_cast(\n prefix: impl AsRe"
},
{
"path": "core/src/ops/change_axes.rs",
"chars": 57331,
"preview": "use std::borrow::Borrow;\nuse std::fmt::Debug;\n\nuse crate::internal::*;\nuse crate::model::{TypedModel, TypedNode};\nuse cr"
},
{
"path": "core/src/ops/cnn/conv/block_quant.rs",
"chars": 3744,
"preview": "use tract_linalg::block_quant::{BlockQuantFact, BlockQuantStorage};\n\nuse crate::internal::*;\n\n#[derive(Debug, Clone, new"
},
{
"path": "core/src/ops/cnn/conv/conv.rs",
"chars": 52063,
"preview": "use tract_data::itertools::izip;\nuse tract_linalg::WeightType;\nuse tract_linalg::block_quant::{BlockQuantFact, PackedBlo"
}
]
// ... and 1371 more files (download for full content)
About this extraction
This page contains the full source code of the snipsco/tract GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1571 files (10.3 MB), approximately 2.8M tokens, and a symbol index with 12902 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.