From e2e4f395c9023156929e58e2a3ced173a80d9fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Tue, 7 May 2024 12:01:18 +0200 Subject: [PATCH] documentation (#179) --- CHANGELOGS.rst | 2 +- onnx_extended/ortops/optim/cuda/__init__.py | 32 +++++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/CHANGELOGS.rst b/CHANGELOGS.rst index 140216d3..9e297f94 100644 --- a/CHANGELOGS.rst +++ b/CHANGELOGS.rst @@ -10,7 +10,7 @@ Change Logs * :pr:`169`: adds custom operator ReplaceZero on CUDA * :pr:`168`: adds custom operator MulSigmoid on CUDA * :pr:`167`: adds custom operator Rotary on CUDA -* :pr:`166`: adds custom operators AddMul, MulAdd on CUDA +* :pr:`166`, :pr:`178`: adds custom operators AddMul, MulAdd on CUDA * :pr:`165`: adds custom operators AddAddAdd, MulMulMul on CUDA * :pr:`163`: use onnxruntime==1.17.3 as default * :pr:`162`: add ScatterNDOfShape implementation on CUDA without atomics diff --git a/onnx_extended/ortops/optim/cuda/__init__.py b/onnx_extended/ortops/optim/cuda/__init__.py index 897482c3..5dccf705 100644 --- a/onnx_extended/ortops/optim/cuda/__init__.py +++ b/onnx_extended/ortops/optim/cuda/__init__.py @@ -24,10 +24,10 @@ def documentation() -> List[str]: textwrap.dedent, [ """ - onnx_extended.ortops.optim.cuda.AddMul + onnx_extended.ortops.optim.cuda.AddAdd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Two consecutive element-wise Add, Mul assuming + Two consecutive element-wise addition assuming all tensors have the same shape (broadcast limited to the first dimensions). @@ -43,17 +43,17 @@ def documentation() -> List[str]: **Outputs** - * (A+B)*C (T): element-wise + * A+B+C (T): element-wise **Constraints** * T: float, float16 """, """ - onnx_extended.ortops.optim.cuda.AddAdd - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + onnx_extended.ortops.optim.cuda.AddAddAdd + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Two consecutive element-wise addition assuming + Three consecutive element-wise addition assuming all tensors have the same shape (broadcast limited to the first dimensions). @@ -66,20 +66,21 @@ def documentation() -> List[str]: * A (T): tensor of type T * B (T): tensor of type T * C (T): tensor of type T + * D (T): tensor of type T **Outputs** - * A+B+C (T): element-wise + * A+B+C+D (T): element-wise **Constraints** * T: float, float16 """, """ - onnx_extended.ortops.optim.cuda.AddAddAdd - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + onnx_extended.ortops.optim.cuda.AddMul + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Three consecutive element-wise addition assuming + Two consecutive element-wise Add, Mul assuming all tensors have the same shape (broadcast limited to the first dimensions). @@ -87,16 +88,19 @@ def documentation() -> List[str]: CUDAExecutionProvider + **Attributes** + + * transposeMiddle: bool, if True, applies transposition [0, 2, 1, 3] on the result + **Inputs** * A (T): tensor of type T * B (T): tensor of type T * C (T): tensor of type T - * D (T): tensor of type T **Outputs** - * A+B+C+D (T): element-wise + * (A+B)*C (T): element-wise **Constraints** @@ -142,7 +146,11 @@ def documentation() -> List[str]: **Provider** CUDAExecutionProvider + + **Attributes** + * transposeMiddle: bool, if True, applies transposition [0, 2, 1, 3] on the result + **Inputs** * A (T): tensor of type T