microsoft/onnxruntime-extensions

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
f74770feed077546874ed7e66d1aba9e2509fea9

Branches

Tags

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

Clone

HTTPS

Download ZIP

onnxruntime_extensions/onnxprocess/torch_wrapper.py

32lines · 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 complex32,
22 complex64,
23 cfloat,
24 complex128,
25 cdouble,
26 quint8,
27 qint8,
28 qint32,
29 bool) # noqa
30
31from torch import randn, onnx # noqa
32from ._tensor import * # noqa
33