"\n\n# Profile the execution of a simple model\n\n*ONNX Runtime* can profile the execution of the model.\nThis example shows how to interpret the results.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import onnx\nimport onnxruntime as rt\nimport numpy\nfrom onnxruntime.datasets import get_example\n\n\ndef change_ir_version(filename, ir_version=6):\n \"onnxruntime==1.2.0 does not support opset <= 7 and ir_version > 6\"\n with open(filename, \"rb\") as f:\n model = onnx.load(f)\n model.ir_version = 6\n if model.opset_import[0].version <= 7:\n model.opset_import[0].version = 11\n return model"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's load a very simple model and compute some prediction.\n\n"