run#
Generates random inputs and executes an ONNX model with the reference evaluator.
Use --dim to set symbolic input dimensions and --dump to save tensors.
python -m onnx_light run model.onnx
python -m onnx_light run model.onnx --dim batch=4 --seed 0 --dump tensors.onnx
Command-line reference#
usage: onnx-light run [-h] [--dim NAME=VALUE] [--seed SEED]
[--verbose [LEVEL]] [--dump PATH]
model
Generates random inputs for every graph input using the onnx-light
deterministic pseudo-random generators and runs the model through the onnx-
light runtime.
positional arguments:
model Path to the input ONNX model file.
options:
-h, --help show this help message and exit
--dim NAME=VALUE Override a symbolic (dynamic) dimension by name. May
be given multiple times (e.g. --dim batch=4 --dim
seq=16). Dimensions that have no concrete value and
are not covered by --dim default to 1.
--seed SEED Integer seed for the random input generator (default:
0).
--verbose [LEVEL], -v [LEVEL]
Print run progress; default level is 1 when the option
is present. Level 1 prints loading progress, input
shapes and output shapes. Level 2 also prints per-node
execution details.
--dump PATH Write all inputs and outputs to PATH as an ONNX model
whose graph.initializer contains one TensorProto per
tensor. Non-array outputs (e.g. sequences) are
skipped.