ONNX бэкенд для TorchDynamo
Для быстрого обзора torch.compiler, см. torch.compiler.
Предупреждение
ONNX бэкенд для torch.compile — это быстро развивающаяся бета-технология.
-
torch.onnx.is_onnxrt_backend_supported() -
Возвращает
True, если зависимости ONNX Runtime установлены и пригодны для интеграции бэкенда TorchDynamo;Falseв противном случае.Пример:
# xdoctest: +REQUIRES(env:TORCH_DOCTEST_ONNX) >>> import torch >>> if torch.onnx.is_onnxrt_backend_supported(): ... @torch.compile(backend="onnxrt") ... def f(x): ... return x * x ... print(f(torch.randn(10))) ... else: ... print("pip install onnx onnxscript-preview onnxruntime") ...- Тип возвращаемого значения
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/onnx_dynamo_onnxruntime_backend.html