Agility#

Examples#

  1. Export a torch model into ONNX

Export a torch model into ONNX

import torch
from deeponnxcustom.tools.onnx_helper import save_as_onnx

class MyModel(torch.nn.Module):
    # ...

nn = MyModel()
save_as_onnx(nn, "my_model.onnx")

(original entry : onnx_helper.py:docstring of deeponnxcustom.tools.onnx_helper.save_as_onnx, line 13)

Ligne de commande#

Commande check#

check

Checks the module works as expected.

<<<

python -m deeponnxcustom check --help

>>>

usage: check [-h] [-v VERBOSE]

Runs a couple of functions to check the module is working.

optional arguments:
  -h, --help            show this help message and exit
  -v VERBOSE, --verbose VERBOSE
                        0 to hide the standout output (default: 1)