Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions onnxscript/onnx_opset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
# ⚠️ WARNING - AUTO-GENERATED CODE - DO NOT EDIT ⚠️
# ⚙️ Generated by 'python -m opgen'
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
# pylint: disable=W0221,W0222,R0901,W0237
# mypy: disable-error-code=override
# ruff: noqa: N801,E741
# ruff: noqa: D214,D402,D405,D411,D412,D416,D417
# --------------------------------------------------------------------------

from __future__ import annotations
Expand Down Expand Up @@ -40,14 +38,12 @@
from onnxscript.onnx_opset._impl.opset21 import Opset21
from onnxscript.onnx_opset._impl.opset22 import Opset22
from onnxscript.onnx_opset._impl.opset23 import Opset23
from onnxscript.onnx_opset._impl.opset24 import Opset24
from onnxscript.onnx_opset._impl.opset_ai_onnx_ml1 import Opset_ai_onnx_ml1
from onnxscript.onnx_opset._impl.opset_ai_onnx_ml2 import Opset_ai_onnx_ml2
from onnxscript.onnx_opset._impl.opset_ai_onnx_ml3 import Opset_ai_onnx_ml3
from onnxscript.onnx_opset._impl.opset_ai_onnx_ml4 import Opset_ai_onnx_ml4
from onnxscript.onnx_opset._impl.opset_ai_onnx_ml5 import Opset_ai_onnx_ml5
from onnxscript.onnx_opset._impl.opset_ai_onnx_preview_training1 import (
Opset_ai_onnx_preview_training1,
)
from onnxscript.values import Opset

__all__ = [
Expand Down Expand Up @@ -75,12 +71,12 @@
"opset21",
"opset22",
"opset23",
"opset24",
"opset_ai_onnx_ml1",
"opset_ai_onnx_ml2",
"opset_ai_onnx_ml3",
"opset_ai_onnx_ml4",
"opset_ai_onnx_ml5",
"opset_ai_onnx_preview_training1",
]


Expand Down Expand Up @@ -113,12 +109,12 @@
opset21 = Opset21()
opset22 = Opset22()
opset23 = Opset23()
opset24 = Opset24()
opset_ai_onnx_ml1 = Opset_ai_onnx_ml1()
opset_ai_onnx_ml2 = Opset_ai_onnx_ml2()
opset_ai_onnx_ml3 = Opset_ai_onnx_ml3()
opset_ai_onnx_ml4 = Opset_ai_onnx_ml4()
opset_ai_onnx_ml5 = Opset_ai_onnx_ml5()
opset_ai_onnx_preview_training1 = Opset_ai_onnx_preview_training1()
all_opsets: Mapping[Tuple[str, int], Opset] = {
(
"",
Expand Down Expand Up @@ -212,6 +208,10 @@
"",
23,
): opset23,
(
"",
24,
): opset24,
(
"ai.onnx.ml",
1,
Expand All @@ -232,8 +232,4 @@
"ai.onnx.ml",
5,
): opset_ai_onnx_ml5,
(
"ai.onnx.preview.training",
1,
): opset_ai_onnx_preview_training1,
}
133 changes: 107 additions & 26 deletions onnxscript/onnx_opset/_impl/opset1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# ⚠️ WARNING - AUTO-GENERATED CODE - DO NOT EDIT ⚠️
# ⚙️ Generated by 'python -m opgen'
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
# pylint: disable=W0221,W0222,R0901,W0237
# mypy: disable-error-code=override
# ruff: noqa: N801,E741
# ruff: noqa: D214,D402,D405,D411,D412,D416,D417
# ruff: noqa: D214, D402, D405, D411, D416, D417
# --------------------------------------------------------------------------

from __future__ import annotations
Expand Down Expand Up @@ -398,7 +397,18 @@ def BatchNormalization(
)

T2_Cast: TypeAlias = Union[
BOOL, DOUBLE, FLOAT, FLOAT16, INT16, INT32, INT64, INT8, UINT16, UINT32, UINT64, UINT8
BOOL,
DOUBLE,
FLOAT,
FLOAT16,
INT16,
INT32,
INT64,
INT8,
UINT16,
UINT32,
UINT64,
UINT8,
]

def Cast(self, input: T1_Cast, *, to: str) -> T2_Cast:
Expand Down Expand Up @@ -837,7 +847,11 @@ def Dropout(
T_Elu = TypeVar("T_Elu", DOUBLE, FLOAT, FLOAT16)

def Elu(
self, X: T_Elu, *, alpha: float = 1.0, consumed_inputs: Optional[Sequence[int]] = None
self,
X: T_Elu,
*,
alpha: float = 1.0,
consumed_inputs: Optional[Sequence[int]] = None,
) -> T_Elu:
r"""[🌐 Elu(1)](https://onnx.ai/onnx/operators/onnx__Elu.html#elu-1 "Online Documentation")

Expand All @@ -849,7 +863,7 @@ def Elu(


Args:
X: 1D input tensor
X: Input tensor

alpha: Coefficient of ELU default to 1.0.

Expand All @@ -859,7 +873,9 @@ def Elu(
schema = get_schema("Elu", 1, "")
op = Op(self, "Elu", schema)
return op(
*self._prepare_inputs(schema, X), alpha=alpha, consumed_inputs=consumed_inputs
*self._prepare_inputs(schema, X),
alpha=alpha,
consumed_inputs=consumed_inputs,
)

T_Equal = TypeVar("T_Equal", BOOL, INT32, INT64)
Expand Down Expand Up @@ -1338,7 +1354,12 @@ def GlobalMaxPool(self, X: T_GlobalMaxPool) -> T_GlobalMaxPool:
T1_Greater: TypeAlias = BOOL

def Greater(
self, A: T_Greater, B: T_Greater, *, axis: Optional[int] = None, broadcast: int = 0
self,
A: T_Greater,
B: T_Greater,
*,
axis: Optional[int] = None,
broadcast: int = 0,
) -> T1_Greater:
r"""[🌐 Greater(1)](https://onnx.ai/onnx/operators/onnx__Greater.html#greater-1 "Online Documentation")

Expand Down Expand Up @@ -1603,7 +1624,11 @@ def LRN(
schema = get_schema("LRN", 1, "")
op = Op(self, "LRN", schema)
return op(
*self._prepare_inputs(schema, X), alpha=alpha, beta=beta, bias=bias, size=size
*self._prepare_inputs(schema, X),
alpha=alpha,
beta=beta,
bias=bias,
size=size,
)

T_LSTM = TypeVar("T_LSTM", DOUBLE, FLOAT, FLOAT16)
Expand Down Expand Up @@ -1822,7 +1847,9 @@ def LeakyRelu(
schema = get_schema("LeakyRelu", 1, "")
op = Op(self, "LeakyRelu", schema)
return op(
*self._prepare_inputs(schema, X), alpha=alpha, consumed_inputs=consumed_inputs
*self._prepare_inputs(schema, X),
alpha=alpha,
consumed_inputs=consumed_inputs,
)

T_Less = TypeVar("T_Less", DOUBLE, FLOAT, FLOAT16)
Expand Down Expand Up @@ -1935,7 +1962,11 @@ def LogSoftmax(self, input: T_LogSoftmax, *, axis: int = 1) -> T_LogSoftmax:
)

def Loop(
self, M: Optional[I_Loop], cond: Optional[B_Loop], *v_initial: V_Loop, body: GraphProto
self,
M: Optional[I_Loop],
cond: Optional[B_Loop],
*v_initial: V_Loop,
body: GraphProto,
) -> V_Loop:
r"""[🌐 Loop(1)](https://onnx.ai/onnx/operators/onnx__Loop.html#loop-1 "Online Documentation")

Expand All @@ -1954,7 +1985,7 @@ def Loop(
This table summarizes the operating modes of this operator with equivalent
C-style code:

Operator inputs defined as (max_trip_count, condition_var).
Operator inputs defined as (max_trip_count, condition_var).

input ("", ""):
for (int i=0; ; ++i) {
Expand Down Expand Up @@ -2493,7 +2524,11 @@ def Or(self, A: T_Or, B: T_Or, *, axis: Optional[int] = None, broadcast: int = 0
T_PRelu = TypeVar("T_PRelu", DOUBLE, FLOAT, FLOAT16)

def PRelu(
self, X: T_PRelu, slope: T_PRelu, *, consumed_inputs: Optional[Sequence[int]] = None
self,
X: T_PRelu,
slope: T_PRelu,
*,
consumed_inputs: Optional[Sequence[int]] = None,
) -> T_PRelu:
r"""[🌐 PRelu(1)](https://onnx.ai/onnx/operators/onnx__PRelu.html#prelu-1 "Online Documentation")

Expand Down Expand Up @@ -2567,7 +2602,10 @@ def Pad(
schema = get_schema("Pad", 1, "")
op = Op(self, "Pad", schema)
return op(
*self._prepare_inputs(schema, data), mode=mode, paddings=paddings, value=value
*self._prepare_inputs(schema, data),
mode=mode,
paddings=paddings,
value=value,
)

T_Pow = TypeVar("T_Pow", DOUBLE, FLOAT, FLOAT16)
Expand Down Expand Up @@ -2975,7 +3013,11 @@ def RandomUniformLike(
schema = get_schema("RandomUniformLike", 1, "")
op = Op(self, "RandomUniformLike", schema)
return op(
*self._prepare_inputs(schema, input), dtype=dtype, high=high, low=low, seed=seed
*self._prepare_inputs(schema, input),
dtype=dtype,
high=high,
low=low,
seed=seed,
)

T_Reciprocal = TypeVar("T_Reciprocal", DOUBLE, FLOAT, FLOAT16)
Expand Down Expand Up @@ -3004,7 +3046,11 @@ def Reciprocal(
T_ReduceL1 = TypeVar("T_ReduceL1", DOUBLE, FLOAT, FLOAT16, INT32, INT64, UINT32, UINT64)

def ReduceL1(
self, data: T_ReduceL1, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceL1,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceL1:
r"""[🌐 ReduceL1(1)](https://onnx.ai/onnx/operators/onnx__ReduceL1.html#reducel1-1 "Online Documentation")

Expand Down Expand Up @@ -3034,7 +3080,11 @@ def ReduceL1(
T_ReduceL2 = TypeVar("T_ReduceL2", DOUBLE, FLOAT, FLOAT16, INT32, INT64, UINT32, UINT64)

def ReduceL2(
self, data: T_ReduceL2, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceL2,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceL2:
r"""[🌐 ReduceL2(1)](https://onnx.ai/onnx/operators/onnx__ReduceL2.html#reducel2-1 "Online Documentation")

Expand Down Expand Up @@ -3066,7 +3116,11 @@ def ReduceL2(
)

def ReduceLogSum(
self, data: T_ReduceLogSum, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceLogSum,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceLogSum:
r"""[🌐 ReduceLogSum(1)](https://onnx.ai/onnx/operators/onnx__ReduceLogSum.html#reducelogsum-1 "Online Documentation")

Expand Down Expand Up @@ -3132,7 +3186,11 @@ def ReduceLogSumExp(
T_ReduceMax = TypeVar("T_ReduceMax", DOUBLE, FLOAT, FLOAT16, INT32, INT64, UINT32, UINT64)

def ReduceMax(
self, data: T_ReduceMax, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceMax,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceMax:
r"""[🌐 ReduceMax(1)](https://onnx.ai/onnx/operators/onnx__ReduceMax.html#reducemax-1 "Online Documentation")

Expand Down Expand Up @@ -3164,7 +3222,11 @@ def ReduceMax(
)

def ReduceMean(
self, data: T_ReduceMean, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceMean,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceMean:
r"""[🌐 ReduceMean(1)](https://onnx.ai/onnx/operators/onnx__ReduceMean.html#reducemean-1 "Online Documentation")

Expand Down Expand Up @@ -3194,7 +3256,11 @@ def ReduceMean(
T_ReduceMin = TypeVar("T_ReduceMin", DOUBLE, FLOAT, FLOAT16, INT32, INT64, UINT32, UINT64)

def ReduceMin(
self, data: T_ReduceMin, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceMin,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceMin:
r"""[🌐 ReduceMin(1)](https://onnx.ai/onnx/operators/onnx__ReduceMin.html#reducemin-1 "Online Documentation")

Expand Down Expand Up @@ -3226,7 +3292,11 @@ def ReduceMin(
)

def ReduceProd(
self, data: T_ReduceProd, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceProd,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceProd:
r"""[🌐 ReduceProd(1)](https://onnx.ai/onnx/operators/onnx__ReduceProd.html#reduceprod-1 "Online Documentation")

Expand Down Expand Up @@ -3256,7 +3326,11 @@ def ReduceProd(
T_ReduceSum = TypeVar("T_ReduceSum", DOUBLE, FLOAT, FLOAT16, INT32, INT64, UINT32, UINT64)

def ReduceSum(
self, data: T_ReduceSum, *, axes: Optional[Sequence[int]] = None, keepdims: int = 1
self,
data: T_ReduceSum,
*,
axes: Optional[Sequence[int]] = None,
keepdims: int = 1,
) -> T_ReduceSum:
r"""[🌐 ReduceSum(1)](https://onnx.ai/onnx/operators/onnx__ReduceSum.html#reducesum-1 "Online Documentation")

Expand Down Expand Up @@ -3371,7 +3445,9 @@ def Reshape(
schema = get_schema("Reshape", 1, "")
op = Op(self, "Reshape", schema)
return op(
*self._prepare_inputs(schema, data), consumed_inputs=consumed_inputs, shape=shape
*self._prepare_inputs(schema, data),
consumed_inputs=consumed_inputs,
shape=shape,
)

T_Selu = TypeVar("T_Selu", DOUBLE, FLOAT, FLOAT16)
Expand Down Expand Up @@ -3632,7 +3708,7 @@ def Softplus(self, X: T_Softplus) -> T_Softplus:


Args:
X: (differentiable) 1D input tensor
X: (differentiable) Input tensor
"""

schema = get_schema("Softplus", 1, "")
Expand Down Expand Up @@ -4019,7 +4095,12 @@ def Unsqueeze(self, data: T_Unsqueeze, *, axes: Sequence[int]) -> T_Unsqueeze:
T_Upsample = TypeVar("T_Upsample", BOOL, DOUBLE, FLOAT, FLOAT16, INT32, INT64)

def Upsample(
self, X: T_Upsample, *, height_scale: float, mode: str = "nearest", width_scale: float
self,
X: T_Upsample,
*,
height_scale: float,
mode: str = "nearest",
width_scale: float,
) -> T_Upsample:
r"""[🌐 Upsample(1)](https://onnx.ai/onnx/operators/onnx__Upsample.html#upsample-1 "Online Documentation")

Expand Down
5 changes: 2 additions & 3 deletions onnxscript/onnx_opset/_impl/opset10.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# ⚠️ WARNING - AUTO-GENERATED CODE - DO NOT EDIT ⚠️
# ⚙️ Generated by 'python -m opgen'
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
# pylint: disable=W0221,W0222,R0901,W0237
# mypy: disable-error-code=override
# ruff: noqa: N801,E741
# ruff: noqa: D214,D402,D405,D411,D412,D416,D417
# ruff: noqa: D402
# --------------------------------------------------------------------------

from __future__ import annotations
Expand Down
Loading
Loading