An opset is ONNX’s standardized set of operators, such as Conv, MatMul, and Relu, with precise mathematical definitions that runtimes must implement identically. This shared semantics helps make ONNX graphs portable across inference runtimes. section 6.4
Listing 6.6 Export ResNet-18 to ONNX
torch.onnx.export(
model,
dummy_input, #A
"resnet18_fp32.onnx",
opset_version=17, #B
input_names=["input"],
output_names=["output"],
dynamic_axes={"input": {0: "batch"},
"output": {0: "batch"}}, #C
dynamo=False, #D
)The export call shows where an opset version is specified: this ResNet-18 example sets opset_version to 17. section 6.4
