Expand description
rten is a runtime for machine learning models.
RTen uses models that are exported from other frameworks such as PyTorch
into ONNX format and then converted into the
inference-optimized .rten
format by the tools in this repository.
§Loading and running models
The basic workflow for loading and running a model is:
- Load the model using Model::load.
- Load the input data (images, audio, text etc.)
- Pre-process the input data to convert it into tensors in the format the model expects. For this you can use RTen’s own tensor types (see rten-tensor) and pre-processing libraries, or popular Rust crates such as ndarray.
- Execute the model using Model::run (or one of the other
run_
methods) - Post-process the results to convert them into meaningful outputs.
See the example projects in rten-examples to see how all these pieces fit together.
§Supported operators
RTen currently implements a subset of ONNX operators. See
the schema.fbs
FlatBuffers schema for currently supported
operators and attributes.
Some operators require additional dependencies and are only available if certain crate features are enabled:
- The
random
feature enables operators that generate random numbers (eg.RandomUniform
).
Re-exports§
pub use ops::FloatOperators;
pub use ops::Input;
pub use ops::Operators;
pub use ops::Output;
pub use timer::Timer;
Modules§
- Connectionist Temporal Classification (CTC) sequence decoding tools.
- The
ops
module exposes the various operators available for machine-learning models.
Macros§
- Generate an unrolled loop.
Structs§
- The central type used to execute RTen machine learning models.
- Metadata for an RTen model.
- Provides access to metadata about a graph node.
- Registry used to instantiate operators when loading a model file.
- Options that control logging and other behaviors when executing a Model.
- A pool which enables reuse of data buffers from tensors and other containers.
Enums§
- Represents the size of a dimension of a runtime-provided value, such as an operator input, output or intermediate value.
- Errors reported by Model::load.
- Error type for errors that occur when de-serializing an operator.
- Specifies sort order for graph run timings.
Traits§
- Trait that that creates the default/built-in implementation of an operator, for use with OpRegistry::register_op.
Type Aliases§
- ID of a node in a Model graph.