microsoft/onnxruntime-extensions

Public

mirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2cf9bab611e9ad563822dee69c44e23bd017fadc

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

onnxruntime_extensions/onnxprocess/torch_wrapper.py

31lines · modecode

1try:
2 import torch
3except ImportError:
4 raise RuntimeError("pytorch not installed, which is required by this ONNX build tool")
5
6from torch import (float32,
7 float,
8 float64,
9 double,
10 float16,
11 bfloat16,
12 half,
13 uint8,
14 int8,
15 int16,
16 short,
17 int32,
18 int,
19 int64,
20 long,
21 complex64,
22 cfloat,
23 complex128,
24 cdouble,
25 quint8,
26 qint8,
27 qint32,
28 bool) # noqa
29
30from torch import randn, onnx # noqa
31from ._tensor import * # noqa
32