{"library":"onnxruntime-directml","title":"ONNX Runtime DirectML","description":"ONNX Runtime with DirectML execution provider for hardware-accelerated ML inference on Windows devices with DirectX 12 compatible GPUs. Version 1.24.4 requires Python >=3.11 and is maintained by Microsoft. Release cadence follows ONNX Runtime releases.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install onnxruntime-directml"],"cli":null},"imports":["from onnxruntime import InferenceSession","from onnxruntime import SessionOptions"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import onnxruntime\nfrom onnxruntime import InferenceSession, SessionOptions\n\n# Enable DirectML execution provider\noptions = SessionOptions()\noptions.enable_training = False\nproviders = ['DmlExecutionProvider', 'CPUExecutionProvider']\nsession = InferenceSession('model.onnx', options, providers=providers)\n# Run inference\nimport numpy as np\ninput_name = session.get_inputs()[0].name\nresult = session.run(None, {input_name: np.random.randn(1, 3, 224, 224).astype(np.float32)})","lang":"python","description":"Basic inference using DirectML provider. Ensure model.onnx exists and is compatible.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}