From b65e77305cfa34718c77f188c38255117fa43c40 Mon Sep 17 00:00:00 2001 From: Byron Changuion <7623249+byronChanguion@users.noreply.github.com> Date: Wed, 1 Apr 2020 09:38:34 -0700 Subject: [PATCH] Move to more recent LLVM commit ID (#64) * Move to more recent LLVM commit ID * Update LLVM cache version from V9 to V10 * Update to latest LLVM commit id from master, roll back conditions in util scripts * Update circlci LLVM cache tag to ensure ci updates builds with latest LLVM commit id * Update README.md to have matching LLVM commit id * Update doc/Dialtects/onnx.md --- .circleci/config.yml | 4 +- MLIR.cmake | 28 +- README.md | 2 +- doc/Dialects/onnx.md | 3743 +++++++++-------- src/Builder/FrontendDialectHelper.hpp | 2 +- .../ONNXToKrnl/ConvertONNXToKrnl.cpp | 6 +- .../ONNXToKrnl/Math/Elementwise.cpp | 8 +- src/Conversion/ONNXToKrnl/Math/Gemm.cpp | 4 +- src/Conversion/ONNXToKrnl/Math/MatMul.cpp | 4 +- src/Conversion/ONNXToKrnl/Math/Reduction.cpp | 4 +- src/Conversion/ONNXToKrnl/Math/Softmax.cpp | 4 +- src/Conversion/ONNXToKrnl/NN/Conv.cpp | 4 +- .../ONNXToKrnl/NN/Normalization.cpp | 4 +- src/Conversion/ONNXToKrnl/NN/Pooling.cpp | 4 +- .../ONNXToKrnl/ONNXToKrnlCommon.hpp | 4 +- src/Conversion/ONNXToKrnl/Tensor/Constant.cpp | 4 +- src/Conversion/ONNXToKrnl/Tensor/Identity.cpp | 4 +- .../ONNXToKrnl/Tensor/PadConstantValuePad.cpp | 4 +- src/Conversion/ONNXToKrnl/Tensor/Reshape.cpp | 4 +- .../ONNXToKrnl/Tensor/Transpose.cpp | 4 +- .../ONNXToKrnl/Tensor/Unsqueeze.cpp | 4 +- src/Dialect/Krnl/KrnlHelper.cpp | 4 +- src/Dialect/Krnl/KrnlOps.cpp | 4 +- src/Dialect/ONNX/ONNXOps.hpp | 2 +- src/Dialect/ONNX/ONNXOps.td.inc | 1 + src/MainUtils.cpp | 2 +- src/Tool/ONNXMLIROpt/ONNXMLIROpt.cpp | 9 +- src/Transform/LowerKrnl.cpp | 22 +- src/Transform/LowerToLLVM.cpp | 14 +- src/Transform/ONNX/AttributePromotion.cpp | 2 +- utils/install-mlir.sh | 2 +- utils/install-onnx-mlir.sh | 0 32 files changed, 2001 insertions(+), 1910 deletions(-) mode change 100644 => 100755 utils/install-mlir.sh mode change 100644 => 100755 utils/install-onnx-mlir.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 956bc08297..701bd514b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ jobs: git submodule update --init --recursive # Use cached mlir installation if possible. - restore_cache: - key: V9-LLVM-PROJECT-{{ arch }} + key: V10-1-LLVM-PROJECT-{{ arch }} - run: name: Install MLIR command: | @@ -29,7 +29,7 @@ jobs: source onnx-mlir/utils/install-mlir.sh fi - save_cache: - key: V9-LLVM-PROJECT-{{ arch }} + key: V10-1-LLVM-PROJECT-{{ arch }} paths: - llvm-project - run: diff --git a/MLIR.cmake b/MLIR.cmake index 15ed11ed12..aede48fd88 100644 --- a/MLIR.cmake +++ b/MLIR.cmake @@ -54,9 +54,11 @@ function(find_mlir_lib lib) NO_DEFAULT_PATH) endfunction(find_mlir_lib) -find_mlir_lib(MLIRAffineOps) +find_mlir_lib(MLIRAffine) find_mlir_lib(MLIRAffineToStandard) find_mlir_lib(MLIRAnalysis) +find_mlir_lib(MLIRCallInterfaces) +find_mlir_lib(MLIRControlFlowInterfaces) find_mlir_lib(MLIRDialect) find_mlir_lib(MLIREDSC) find_mlir_lib(MLIRExecutionEngine) @@ -65,21 +67,25 @@ find_mlir_lib(MLIRLLVMIR) find_mlir_lib(MLIRLoopAnalysis) find_mlir_lib(MLIRLoopToStandard) find_mlir_lib(MLIRLoopOps) +find_mlir_lib(MLIRLoopLikeInterface) +find_mlir_lib(MLIRLLVMIRTransforms) +find_mlir_lib(MLIRMlirOptMain) find_mlir_lib(MLIRParser) find_mlir_lib(MLIRPass) find_mlir_lib(MLIRStandardOps) find_mlir_lib(MLIRStandardToLLVM) +find_mlir_lib(MLIRSideEffects) find_mlir_lib(MLIRTargetLLVMIR) find_mlir_lib(MLIRTransforms) find_mlir_lib(MLIRTransformUtils) find_mlir_lib(MLIRSupport) -find_mlir_lib(MLIRMlirOptMain) +find_mlir_lib(MLIROpenMP) find_mlir_lib(MLIROptLib) find_mlir_lib(MLIRTargetLLVMIRModuleTranslation) find_mlir_lib(MLIRTargetLLVMIR) find_mlir_lib(MLIRTransformUtils) find_mlir_lib(MLIRTranslation) -find_mlir_lib(MLIRVectorOps) +find_mlir_lib(MLIRVector) find_mlir_lib(LLVMCore) find_mlir_lib(LLVMSupport) @@ -87,6 +93,7 @@ find_mlir_lib(LLVMAsmParser) find_mlir_lib(LLVMBinaryFormat) find_mlir_lib(LLVMRemarks) find_mlir_lib(LLVMIRReader) +find_mlir_lib(LLVMMLIRTableGen) find_mlir_lib(LLVMTransformUtils) find_mlir_lib(LLVMBitstreamReader) find_mlir_lib(LLVMAnalysis) @@ -97,6 +104,7 @@ find_mlir_lib(LLVMMCParser) find_mlir_lib(LLVMObject) find_mlir_lib(LLVMProfileData) find_mlir_lib(LLVMDemangle) +find_mlir_lib(LLVMFrontendOpenMP) set(MLIRLibsOnce @@ -107,30 +115,38 @@ set(MLIRLibsOnce ${LLVMBitstreamReader} ${LLVMBitWriter} ${LLVMCore} + ${LLVMFrontendOpenMP} ${LLVMIRReader} ${LLVMMC} ${LLVMMCParser} + ${LLVMMLIRTableGen} ${LLVMObject} ${LLVMRemarks} ${LLVMSupport} ${LLVMTransformUtils} ${LLVMProfileData} ${LLVMDemangle} - ${MLIRAffineOps} + ${MLIRAffine} ${MLIRAffineToStandard} ${MLIRAnalysis} + ${MLIRCallInterfaces} + ${MLIRControlFlowInterfaces} ${MLIRDialect} ${MLIREDSC} ${MLIRExecutionEngine} ${MLIRIR} ${MLIRLLVMIR} + ${MLIRLLVMIRTransforms} ${MLIRLoopToStandard} ${MLIRLoopOps} ${MLIRLoopAnalysis} + ${MLIRLoopLikeInterface} + ${MLIROpenMP} ${MLIRMlirOptMain} ${MLIROptLib} ${MLIRParser} ${MLIRPass} + ${MLIRSideEffects} ${MLIRStandardOps} ${MLIRStandardToLLVM} ${MLIRSupport} @@ -147,13 +163,13 @@ set(MLIRLibs set(MLIRWholeArchiveLibs MLIRAffineToStandard - MLIRAffineOps + MLIRAffine MLIRLLVMIR MLIRStandardOps MLIRStandardToLLVM MLIRTransforms MLIRLoopToStandard - MLIRVectorOps + MLIRVector MLIRLoopOps) function(whole_archive_link target lib_dir) diff --git a/README.md b/README.md index eb32de5f5e..e0e8a457ce 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Firstly, install MLIR (as a part of LLVM-Project): ``` bash git clone https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX MLIR. -cd llvm-project && git checkout 076475713c236081a3247a53e9dbab9043c3eac2 && cd .. +cd llvm-project && git checkout 07e462526d0cbae40b320e1a4307ce11e197fb0a && cd .. mkdir llvm-project/build cd llvm-project/build cmake -G Ninja ../llvm \ diff --git a/doc/Dialects/onnx.md b/doc/Dialects/onnx.md index 6170f9e228..9d11120489 100644 --- a/doc/Dialects/onnx.md +++ b/doc/Dialects/onnx.md @@ -1,74 +1,63 @@ -# Dialect 'onnx' definition +### `onnx.Abs` (ONNXAbsOp) -[TOC] - -## Operation definition - -### onnx.Abs (ONNXAbsOp) ONNX Abs operation -#### Description: - - "Absolute takes one input data (Tensor) and produces one output data" "(Tensor) where the absolute is, y = abs(x), is applied to" "the tensor elementwise." #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -### onnx.Acos (ONNXAcosOp) -ONNX Acos operation - -#### Description: +### `onnx.Acos` (ONNXAcosOp) +ONNX Acos operation "Calculates the arccosine (inverse of cosine) of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Acosh (ONNXAcoshOp) -ONNX Acosh operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Acosh` (ONNXAcoshOp) +ONNX Acosh operation "Calculates the hyperbolic arccosine of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.Add (ONNXAddOp) -ONNX Add operation - -#### Description: +### `onnx.Add` (ONNXAddOp) +ONNX Add operation "Performs element-wise binary addition (with Numpy-style broadcasting support)." "" @@ -76,21 +65,20 @@ ONNX Add operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -### onnx.And (ONNXAndOp) -ONNX And operation - -#### Description: +### `onnx.And` (ONNXAndOp) +ONNX And operation "Returns the tensor resulted from performing the `and` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." @@ -99,149 +87,148 @@ ONNX And operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values - -### onnx.ArgMax (ONNXArgMaxOp) -ONNX ArgMax operation +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ArgMax` (ONNXArgMaxOp) +ONNX ArgMax operation "Computes the indices of the max elements of the input tensor's element along the " "provided axis. The resulted tensor has the same rank as the input if keepdims equal 1." "If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. " "The type of the output tensor is integer." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ArgMin (ONNXArgMinOp) -ONNX ArgMin operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values +### `onnx.ArgMin` (ONNXArgMinOp) + +ONNX ArgMin operation "Computes the indices of the min elements of the input tensor's element along the " "provided axis. The resulted tensor has the same rank as the input if keepdims equal 1." "If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. " "The type of the output tensor is integer." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.Asin (ONNXAsinOp) -ONNX Asin operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Asin` (ONNXAsinOp) +ONNX Asin operation "Calculates the arcsine (inverse of sine) of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.Asinh (ONNXAsinhOp) -ONNX Asinh operation - -#### Description: +### `onnx.Asinh` (ONNXAsinhOp) +ONNX Asinh operation "Calculates the hyperbolic arcsine of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Atan (ONNXAtanOp) -ONNX Atan operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Atan` (ONNXAtanOp) +ONNX Atan operation "Calculates the arctangent (inverse of tangent) of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Atanh (ONNXAtanhOp) -ONNX Atanh operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Atanh` (ONNXAtanhOp) +ONNX Atanh operation "Calculates the hyperbolic arctangent of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.AveragePool (ONNXAveragePoolOp) -ONNX AveragePool operation - -#### Description: +### `onnx.AveragePool` (ONNXAveragePoolOp) +ONNX AveragePool operation "AveragePool consumes an input tensor X and applies average pooling across" " the tensor according to kernel sizes, stride sizes, and pad lengths." @@ -273,30 +260,32 @@ ONNX AveragePool operation " The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero)." " " -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `ceil_mode` | `IntegerAttr` | 64-bit integer attribute attribute | -| `count_include_pad` | `IntegerAttr` | 64-bit integer attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`ceil_mode` | IntegerAttr | 64-bit signless integer attribute +`count_include_pad` | IntegerAttr | 64-bit signless integer attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.BatchNormalization (ONNXBatchNormalizationOp) -ONNX BatchNormalization operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.BatchNormalization` (ONNXBatchNormalizationOp) + +ONNX BatchNormalization operation "Carries out batch normalization as described in the paper" "https://arxiv.org/abs/1502.03167. Depending on the mode it is being run," @@ -309,34 +298,36 @@ ONNX BatchNormalization operation "to flatten the input shape to (N x C*D1*D2 ..*Dn) before a BatchNormalization Op." "This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `scale`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values -1. `mean`: memref of any type values or tensor of any type values -1. `var`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `epsilon` | `FloatAttr` | 32-bit float attribute attribute | -| `momentum` | `FloatAttr` | 32-bit float attribute attribute | +`epsilon` | FloatAttr | 32-bit float attribute +`momentum` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values -1. `out_mean`: memref of any type values or tensor of any type values or none type -1. `out_var`: memref of any type values or tensor of any type values or none type -1. `saved_mean`: memref of any type values or tensor of any type values or none type -1. `saved_var`: memref of any type values or tensor of any type values or none type +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`scale` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values +`mean` | memref of any type values or tensor of any type values +`var` | memref of any type values or tensor of any type values -### onnx.BatchNormalizationTestMode (ONNXBatchNormalizationTestModeOp) -ONNX BatchNormalization operation in test mode +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +`out_mean` | memref of any type values or tensor of any type values or none type +`out_var` | memref of any type values or tensor of any type values or none type +`saved_mean` | memref of any type values or tensor of any type values or none type +`saved_var` | memref of any type values or tensor of any type values or none type -#### Description: +### `onnx.BatchNormalizationTestMode` (ONNXBatchNormalizationTestModeOp) +ONNX BatchNormalization operation in test mode "Carries out batch normalization as described in the paper" "https://arxiv.org/abs/1502.03167. Depending on the mode it is being run," @@ -349,30 +340,32 @@ ONNX BatchNormalization operation in test mode "to flatten the input shape to (N x C*D1*D2 ..*Dn) before a BatchNormalization Op." "This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `scale`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values -1. `mean`: memref of any type values or tensor of any type values -1. `var`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `epsilon` | `FloatAttr` | 32-bit float attribute attribute | -| `momentum` | `FloatAttr` | 32-bit float attribute attribute | +`epsilon` | FloatAttr | 32-bit float attribute +`momentum` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `o_Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`scale` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values +`mean` | memref of any type values or tensor of any type values +`var` | memref of any type values or tensor of any type values -### onnx.BitShift (ONNXBitShiftOp) -ONNX BitShift operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`o_Y` | memref of any type values or tensor of any type values +### `onnx.BitShift` (ONNXBitShiftOp) + +ONNX BitShift operation "Bitwise shift operator performs element-wise operation. For each input element, if the" " attribute \"direction\" is \"RIGHT\", this operator moves its binary representation toward" @@ -387,26 +380,28 @@ ONNX BitShift operation " not necessarily identical." "This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md)." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `Y`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `direction` | `StringAttr` | string attribute attribute | +`direction` | StringAttr | string attribute -#### Results: +#### Operands: -1. `Z`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`Y` | memref of any type values or tensor of any type values -### onnx.Cast (ONNXCastOp) -ONNX Cast operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Z` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Cast` (ONNXCastOp) +ONNX Cast operation "The operator casts the elements of a given input tensor to a data type" "specified by the 'to' argument and returns an output tensor of the same size in" @@ -428,25 +423,27 @@ ONNX Cast operation "For example, a 64-bit float 3.1415926459 may be round to a 32-bit float 3.141592. Similarly, converting" "an integer 36 to Boolean may produce 1 because we truncate bits which can't be stored in the targeted type." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `to` | `IntegerAttr` | 64-bit integer attribute attribute | +`to` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Ceil (ONNXCeilOp) -ONNX Ceil operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Ceil` (ONNXCeilOp) +ONNX Ceil operation "Ceil takes one input data (Tensor) and produces one output data" "(Tensor) where the ceil is, y = ceil(x), is applied to" @@ -454,20 +451,19 @@ ONNX Ceil operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -### onnx.Clip (ONNXClipOp) -ONNX Clip operation - -#### Description: +### `onnx.Clip` (ONNXClipOp) +ONNX Clip operation "Clip operator limits the given input within an interval. The interval is" "specified by the inputs 'min' and 'max'. They default to" @@ -475,202 +471,210 @@ ONNX Clip operation #### Operands: -1. `input`: memref of any type values or tensor of any type values -1. `min`: memref of any type values or tensor of any type values or none type -1. `max`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values +`min` | memref of any type values or tensor of any type values or none type +`max` | memref of any type values or tensor of any type values or none type #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.Compress (ONNXCompressOp) -ONNX Compress operation - -#### Description: +### `onnx.Compress` (ONNXCompressOp) +ONNX Compress operation "Selects slices from an input tensor along a given axis where condition evaluates to True for each axis index." " In case axis is not provided, input is flattened before elements are selected." " Compress behaves like numpy.compress: https://docs.scipy.org/doc/numpy/reference/generated/numpy.compress.html" " " -#### Operands: - -1. `input`: memref of any type values or tensor of any type values -1. `condition`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values +`condition` | memref of any type values or tensor of any type values -### onnx.ConcatFromSequence (ONNXConcatFromSequenceOp) -ONNX ConcatFromSequence operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.ConcatFromSequence` (ONNXConcatFromSequenceOp) + +ONNX ConcatFromSequence operation "Concatenate a sequence of tensors into a single tensor." "All input tensors must have the same shape, except for the dimension size of the axis to concatenate on." "By default 'new_axis' is 0, the behavior is similar to numpy.concatenate." "When 'new_axis' is 1, the behavior is similar to numpy.stack." -#### Operands: - -1. `input_sequence`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `new_axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`new_axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: - -1. `concat_result`: memref of any type values or tensor of any type values +#### Operands: -### onnx.Concat (ONNXConcatOp) -ONNX Concat operation +| Operand | Description | +| :-----: | ----------- | +`input_sequence` | memref of any type values or tensor of any type values -#### Description: +#### Results: +| Result | Description | +| :----: | ----------- | +`concat_result` | memref of any type values or tensor of any type values -"Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on." +### `onnx.Concat` (ONNXConcatOp) -#### Operands: +ONNX Concat operation -1. `inputs`: memref of any type values or tensor of any type values +"Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on." #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `concat_result`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`inputs` | memref of any type values or tensor of any type values -### onnx.ConstantOfShape (ONNXConstantOfShapeOp) -ONNX ConstantOfShape operation - -#### Description: +#### Results: +| Result | Description | +| :----: | ----------- | +`concat_result` | memref of any type values or tensor of any type values -"Generate a tensor with given value and shape." +### `onnx.ConstantOfShape` (ONNXConstantOfShapeOp) -#### Operands: +ONNX ConstantOfShape operation -1. `input`: memref of any type values or tensor of any type values +"Generate a tensor with given value and shape." #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `value` | `Attribute` | any attribute attribute | +`value` | Attribute | any attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Constant (ONNXConstantOp) -ONNX Constant operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Constant` (ONNXConstantOp) + +ONNX Constant operation "A constant tensor. Exactly one of the two attributes, either value or sparse_value," "must be specified." -#### Operands: - - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `sparse_value` | `Attribute` | any attribute attribute | -| `value` | `Attribute` | any attribute attribute | +`sparse_value` | Attribute | any attribute +`value` | Attribute | any attribute #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.ConvInteger (ONNXConvIntegerOp) -ONNX ConvInteger operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ConvInteger` (ONNXConvIntegerOp) +ONNX ConvInteger operation "The integer convolution operator consumes an input tensor, its zero-point, a filter, and its zero-point," "and computes the output. The production MUST never overflow. The accumulation may overflow if and only if in 32 bits." -#### Operands: - -1. `x`: memref of any type values or tensor of any type values -1. `w`: memref of any type values or tensor of any type values -1. `x_zero_point`: memref of any type values or tensor of any type values or none type -1. `w_zero_point`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `dilations` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `group` | `IntegerAttr` | 64-bit integer attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`dilations` | ArrayAttr | 64-bit integer array attribute +`group` | IntegerAttr | 64-bit signless integer attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`x` | memref of any type values or tensor of any type values +`w` | memref of any type values or tensor of any type values +`x_zero_point` | memref of any type values or tensor of any type values or none type +`w_zero_point` | memref of any type values or tensor of any type values or none type -### onnx.Conv (ONNXConvOp) -ONNX Conv operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values +### `onnx.Conv` (ONNXConvOp) + +ONNX Conv operation "The convolution operator consumes an input tensor and a filter, and" "computes the output." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `W`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `dilations` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `group` | `IntegerAttr` | 64-bit integer attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`dilations` | ArrayAttr | 64-bit integer array attribute +`group` | IntegerAttr | 64-bit signless integer attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`W` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values or none type -### onnx.ConvTranspose (ONNXConvTransposeOp) -ONNX ConvTranspose operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.ConvTranspose` (ONNXConvTransposeOp) + +ONNX ConvTranspose operation "The convolution transpose operator consumes an input tensor and a filter," "and computes the output." @@ -687,72 +691,72 @@ ONNX ConvTranspose operation "" " " -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `W`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `dilations` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `group` | `IntegerAttr` | 64-bit integer attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `output_padding` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `output_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`dilations` | ArrayAttr | 64-bit integer array attribute +`group` | IntegerAttr | 64-bit signless integer attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`output_padding` | ArrayAttr | 64-bit integer array attribute +`output_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`W` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values or none type -### onnx.Cos (ONNXCosOp) -ONNX Cos operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.Cos` (ONNXCosOp) + +ONNX Cos operation "Calculates the cosine of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Cosh (ONNXCoshOp) -ONNX Cosh operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Cosh` (ONNXCoshOp) +ONNX Cosh operation "Calculates the hyperbolic cosine of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.CumSum (ONNXCumSumOp) -ONNX CumSum operation - -#### Description: +### `onnx.CumSum` (ONNXCumSumOp) +ONNX CumSum operation "Performs cumulative sum of the input elements along the given axis." "By default, it will do the sum inclusively meaning the first element is copied as is." @@ -775,27 +779,29 @@ ONNX CumSum operation "```" " " -#### Operands: - -1. `x`: memref of any type values or tensor of any type values -1. `axis`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `exclusive` | `IntegerAttr` | 64-bit integer attribute attribute | -| `reverse` | `IntegerAttr` | 64-bit integer attribute attribute | +`exclusive` | IntegerAttr | 64-bit signless integer attribute +`reverse` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`x` | memref of any type values or tensor of any type values +`axis` | memref of any type values or tensor of any type values -### onnx.DepthToSpace (ONNXDepthToSpaceOp) -ONNX DepthToSpace operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values +### `onnx.DepthToSpace` (ONNXDepthToSpaceOp) + +ONNX DepthToSpace operation "DepthToSpace rearranges (permutes) data from depth into blocks of spatial data." "This is the reverse transformation of SpaceToDepth. More specifically, this op outputs a copy of" @@ -825,26 +831,28 @@ ONNX DepthToSpace operation "y = np.reshape(tmp, [b, c // (blocksize ** 2), h * blocksize, w * blocksize])" "" -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `blocksize` | `IntegerAttr` | 64-bit integer attribute attribute | -| `mode` | `StringAttr` | string attribute attribute | +`blocksize` | IntegerAttr | 64-bit signless integer attribute +`mode` | StringAttr | string attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.DequantizeLinear (ONNXDequantizeLinearOp) -ONNX DequantizeLinear operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.DequantizeLinear` (ONNXDequantizeLinearOp) +ONNX DequantizeLinear operation "The linear dequantization operator. It consumes a quantized tensor, a scale, a zero point to compute the full precision tensor." "The dequantization formula is y = (x - x_zero_point) * x_scale. 'x_scale' and 'x_zero_point' must have same shape." @@ -853,22 +861,21 @@ ONNX DequantizeLinear operation #### Operands: -1. `x`: memref of any type values or tensor of any type values -1. `x_scale`: memref of any type values or tensor of any type values -1. `x_zero_point`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`x` | memref of any type values or tensor of any type values +`x_scale` | memref of any type values or tensor of any type values +`x_zero_point` | memref of any type values or tensor of any type values or none type #### Results: -1. `y`: memref of any type values or tensor of any type values - -### onnx.Det (ONNXDetOp) -ONNX Det operation +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Det` (ONNXDetOp) +ONNX Det operation "Det calculates determinant of a square matrix or batches of square matrices." "Det takes one input tensor of shape `[*, M, M]`, where `*` is zero or more batch dimensions," @@ -878,20 +885,19 @@ ONNX Det operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Div (ONNXDivOp) -ONNX Div operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Div` (ONNXDivOp) +ONNX Div operation "Performs element-wise binary division (with Numpy-style broadcasting support)." "" @@ -899,21 +905,20 @@ ONNX Div operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -### onnx.Dropout (ONNXDropoutOp) -ONNX Dropout operation - -#### Description: +### `onnx.Dropout` (ONNXDropoutOp) +ONNX Dropout operation "Dropout takes one input floating tensor and produces two tensor outputs," "output (floating tensor) and mask (`Tensor`). Depending on whether it is" @@ -922,26 +927,28 @@ ONNX Dropout operation "the training phase, so during testing nothing needs to be done." "This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `ratio` | `FloatAttr` | 32-bit float attribute attribute | +`ratio` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values -1. `mask`: memref of any type values or tensor of any type values or none type +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.DynamicQuantizeLinear (ONNXDynamicQuantizeLinearOp) -ONNX DynamicQuantizeLinear operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +`mask` | memref of any type values or tensor of any type values or none type +### `onnx.DynamicQuantizeLinear` (ONNXDynamicQuantizeLinearOp) + +ONNX DynamicQuantizeLinear operation "A Function to fuse calculation for Scale, Zero Point and FP32->8Bit convertion of FP32 Input data." "Outputs Scale, ZeroPoint and Quantized Input for a given FP32 Input." @@ -968,64 +975,54 @@ ONNX DynamicQuantizeLinear operation #### Operands: -1. `x`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`x` | memref of any type values or tensor of any type values #### Results: -1. `y`: memref of any type values or tensor of any type values -1. `y_scale`: memref of any type values or tensor of any type values -1. `y_zero_point`: memref of any type values or tensor of any type values - -### onnx.Elu (ONNXEluOp) -ONNX Elu operation +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values +`y_scale` | memref of any type values or tensor of any type values +`y_zero_point` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Elu` (ONNXEluOp) +ONNX Elu operation "Elu takes one input data (Tensor) and produces one output data" "(Tensor) where the function `f(x) = alpha * (exp(x) - 1.) for x <" "0`, `f(x) = x for x >= 0`., is applied to the tensor elementwise." "" -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `alpha` | `FloatAttr` | 32-bit float attribute attribute | - -#### Results: - -1. `Y`: memref of any type values or tensor of any type values - -### onnx.EntryPoint (ONNXEntryPointOp) -Indicate ONNX entry point - -#### Description: - - -The "onnx.EntryPoint" function indicates the main entry point of ONNX model. +`alpha` | FloatAttr | 32-bit float attribute #### Operands: +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -#### Attributes: +#### Results: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Results: +### `onnx.EntryPoint` (ONNXEntryPointOp) +Indicate ONNX entry point -### onnx.Equal (ONNXEqualOp) -ONNX Equal operation +The "onnx.EntryPoint" function indicates the main entry point of ONNX model. -#### Description: +### `onnx.Equal` (ONNXEqualOp) +ONNX Equal operation "Returns the tensor resulted from performing the `equal` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." @@ -1034,59 +1031,56 @@ ONNX Equal operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -### onnx.Erf (ONNXErfOp) -ONNX Erf operation - -#### Description: +### `onnx.Erf` (ONNXErfOp) +ONNX Erf operation "Computes the error function of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Exp (ONNXExpOp) -ONNX Exp operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Exp` (ONNXExpOp) +ONNX Exp operation "Calculates the exponential of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Expand (ONNXExpandOp) -ONNX Expand operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Expand` (ONNXExpandOp) +ONNX Expand operation "Broadcast the input tensor following the given shape and the broadcast rule." "The broadcast rule is similar to numpy.array(input) * numpy.ones(shape):" @@ -1099,21 +1093,20 @@ ONNX Expand operation #### Operands: -1. `input`: memref of any type values or tensor of any type values -1. `shape`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values +`shape` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.EyeLike (ONNXEyeLikeOp) -ONNX EyeLike operation - -#### Description: +### `onnx.EyeLike` (ONNXEyeLikeOp) +ONNX EyeLike operation "Generate a 2D tensor (matrix) with ones on the diagonal and zeros everywhere else. Only 2D" "tensors are supported, i.e. input T1 must be of rank 2. The shape of the output tensor is the" @@ -1123,50 +1116,54 @@ ONNX EyeLike operation "The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the" "TensorProto message and be valid as an output type." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `dtype` | `IntegerAttr` | 64-bit integer attribute attribute | -| `k` | `IntegerAttr` | 64-bit integer attribute attribute | +`dtype` | IntegerAttr | 64-bit signless integer attribute +`k` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Flatten (ONNXFlattenOp) -ONNX Flatten operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Flatten` (ONNXFlattenOp) + +ONNX Flatten operation "Flattens the input tensor into a 2D matrix. If input tensor has shape" "(d_0, d_1, ... d_n) then the output will have shape" "(d_0 X d_1 ... d_(axis-1), d_axis X d_(axis+1) ... X dn)." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Floor (ONNXFloorOp) -ONNX Floor operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Floor` (ONNXFloorOp) +ONNX Floor operation "Floor takes one input data (Tensor) and produces one output data" "(Tensor) where the floor is, y = floor(x), is applied to" @@ -1174,20 +1171,19 @@ ONNX Floor operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.GRU (ONNXGRUOp) -ONNX GRU operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.GRU` (ONNXGRUOp) +ONNX GRU operation "Computes an one-layer GRU. This operator is usually supported via some custom" "implementation such as CuDNN." @@ -1263,37 +1259,39 @@ ONNX GRU operation " - Ht = (1 - zt) (.) ht + zt (.) Ht-1" "This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `W`: memref of any type values or tensor of any type values -1. `R`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values or none type -1. `sequence_lens`: memref of any type values or tensor of any type values or none type -1. `initial_h`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `activation_alpha` | `ArrayAttr` | 32-bit float array attribute attribute | -| `activation_beta` | `ArrayAttr` | 32-bit float array attribute attribute | -| `activations` | `ArrayAttr` | string array attribute attribute | -| `clip` | `FloatAttr` | 32-bit float attribute attribute | -| `direction` | `StringAttr` | string attribute attribute | -| `hidden_size` | `IntegerAttr` | 64-bit integer attribute attribute | -| `linear_before_reset` | `IntegerAttr` | 64-bit integer attribute attribute | +`activation_alpha` | ArrayAttr | 32-bit float array attribute +`activation_beta` | ArrayAttr | 32-bit float array attribute +`activations` | ArrayAttr | string array attribute +`clip` | FloatAttr | 32-bit float attribute +`direction` | StringAttr | string attribute +`hidden_size` | IntegerAttr | 64-bit signless integer attribute +`linear_before_reset` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values or none type -1. `Y_h`: memref of any type values or tensor of any type values or none type +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`W` | memref of any type values or tensor of any type values +`R` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values or none type +`sequence_lens` | memref of any type values or tensor of any type values or none type +`initial_h` | memref of any type values or tensor of any type values or none type -### onnx.GatherElements (ONNXGatherElementsOp) -ONNX GatherElements operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values or none type +`Y_h` | memref of any type values or tensor of any type values or none type -#### Description: +### `onnx.GatherElements` (ONNXGatherElementsOp) +ONNX GatherElements operation "GatherElements takes two inputs `data` and `indices` of the same rank r >= 1" "and an optional attribute `axis` that identifies an axis of `data`" @@ -1351,26 +1349,28 @@ ONNX GatherElements operation " ]" "```" -#### Operands: - -1. `data`: memref of any type values or tensor of any type values -1. `indices`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`indices` | memref of any type values or tensor of any type values -### onnx.GatherND (ONNXGatherNDOp) -ONNX GatherND operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.GatherND` (ONNXGatherNDOp) + +ONNX GatherND operation "Given `data` tensor of rank `r` >= 1, and `indices` tensor of rank `q` >= 1, this operator gathers " "slices of `data` into an output tensor of rank `q + r - indices_shape[-1] - 1`." @@ -1440,21 +1440,20 @@ ONNX GatherND operation #### Operands: -1. `data`: memref of any type values or tensor of any type values -1. `indices`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`indices` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Gather (ONNXGatherOp) -ONNX Gather operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Gather` (ONNXGatherOp) +ONNX Gather operation "Given `data` tensor of rank r >= 1, and `indices` tensor of rank q, gather" "entries of the axis dimension of `data` (by default outer-most one as axis=0) indexed by `indices`, and concatenates" @@ -1514,26 +1513,28 @@ ONNX Gather operation " ]" "```" -#### Operands: - -1. `data`: memref of any type values or tensor of any type values -1. `indices`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`indices` | memref of any type values or tensor of any type values -### onnx.Gemm (ONNXGemmOp) -ONNX Gemm operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Gemm` (ONNXGemmOp) + +ONNX Gemm operation "General Matrix multiplication:" "https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3" @@ -1549,30 +1550,32 @@ ONNX Gemm operation "This operator supports **unidirectional broadcasting** (tensor C should be unidirectional broadcastable to tensor A * B); for more details please check [the doc](Broadcasting.md)." "This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted." -#### Operands: - -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values -1. `C`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `alpha` | `FloatAttr` | 32-bit float attribute attribute | -| `beta` | `FloatAttr` | 32-bit float attribute attribute | -| `transA` | `IntegerAttr` | 64-bit integer attribute attribute | -| `transB` | `IntegerAttr` | 64-bit integer attribute attribute | +`alpha` | FloatAttr | 32-bit float attribute +`beta` | FloatAttr | 32-bit float attribute +`transA` | IntegerAttr | 64-bit signless integer attribute +`transB` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values +`C` | memref of any type values or tensor of any type values or none type -### onnx.GlobalAveragePool (ONNXGlobalAveragePoolOp) -ONNX GlobalAveragePool operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.GlobalAveragePool` (ONNXGlobalAveragePoolOp) + +ONNX GlobalAveragePool operation "GlobalAveragePool consumes an input tensor X and applies average pooling across" " the values in the same channel. This is equivalent to AveragePool with kernel size" @@ -1580,44 +1583,45 @@ ONNX GlobalAveragePool operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -### onnx.GlobalLpPool (ONNXGlobalLpPoolOp) -ONNX GlobalLpPool operation - -#### Description: +### `onnx.GlobalLpPool` (ONNXGlobalLpPoolOp) +ONNX GlobalLpPool operation "GlobalLpPool consumes an input tensor X and applies lp pool pooling across" " the values in the same channel. This is equivalent to LpPool with kernel size" " equal to the spatial dimension of input tensor." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `p` | `IntegerAttr` | 64-bit integer attribute attribute | +`p` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.GlobalMaxPool (ONNXGlobalMaxPoolOp) -ONNX GlobalMaxPool operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.GlobalMaxPool` (ONNXGlobalMaxPoolOp) + +ONNX GlobalMaxPool operation "GlobalMaxPool consumes an input tensor X and applies max pooling across" " the values in the same channel. This is equivalent to MaxPool with kernel size" @@ -1625,20 +1629,19 @@ ONNX GlobalMaxPool operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -### onnx.Greater (ONNXGreaterOp) -ONNX Greater operation - -#### Description: +### `onnx.Greater` (ONNXGreaterOp) +ONNX Greater operation "Returns the tensor resulted from performing the `greater` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." @@ -1647,46 +1650,47 @@ ONNX Greater operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values - -### onnx.HardSigmoid (ONNXHardSigmoidOp) -ONNX HardSigmoid operation +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -#### Description: +### `onnx.HardSigmoid` (ONNXHardSigmoidOp) +ONNX HardSigmoid operation "HardSigmoid takes one input data (Tensor) and produces one output data" "(Tensor) where the HardSigmoid function, y = max(0, min(1, alpha * x + beta))," "is applied to the tensor elementwise." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `alpha` | `FloatAttr` | 32-bit float attribute attribute | -| `beta` | `FloatAttr` | 32-bit float attribute attribute | +`alpha` | FloatAttr | 32-bit float attribute +`beta` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.Hardmax (ONNXHardmaxOp) -ONNX Hardmax operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.Hardmax` (ONNXHardmaxOp) + +ONNX Hardmax operation "The operator computes the hardmax (1 for the first maximum value, and 0 for all others) values for each layer in the batch" " of the given input." @@ -1703,67 +1707,70 @@ ONNX Hardmax operation "will throw errors. The output tensor has the same shape" "and contains the hardmax values of the corresponding input." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Identity (ONNXIdentityOp) -ONNX Identity operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Identity` (ONNXIdentityOp) + +ONNX Identity operation "Identity operator" #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.If (ONNXIfOp) -ONNX If operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.If` (ONNXIfOp) +ONNX If operation "If conditional" -#### Operands: - -1. `cond`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `else_branch` | `Attribute` | any attribute attribute | -| `then_branch` | `Attribute` | any attribute attribute | +`else_branch` | Attribute | any attribute +`then_branch` | Attribute | any attribute -#### Results: +#### Operands: -1. `outputs`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`cond` | memref of any type values or tensor of any type values -### onnx.InstanceNormalization (ONNXInstanceNormalizationOp) -ONNX InstanceNormalization operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`outputs` | memref of any type values or tensor of any type values +### `onnx.InstanceNormalization` (ONNXInstanceNormalizationOp) + +ONNX InstanceNormalization operation "Carries out instance normalization as described in the paper" "https://arxiv.org/abs/1607.08022." @@ -1772,69 +1779,72 @@ ONNX InstanceNormalization operation "where mean and variance are computed per instance per channel." "" -#### Operands: - -1. `input`: memref of any type values or tensor of any type values -1. `scale`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `epsilon` | `FloatAttr` | 32-bit float attribute attribute | - -#### Results: +`epsilon` | FloatAttr | 32-bit float attribute -1. `output`: memref of any type values or tensor of any type values +#### Operands: -### onnx.IsInf (ONNXIsInfOp) -ONNX IsInf operation +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values +`scale` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values -#### Description: +#### Results: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -"Map infinity to true and other values to false." +### `onnx.IsInf` (ONNXIsInfOp) -#### Operands: +ONNX IsInf operation -1. `X`: memref of any type values or tensor of any type values +"Map infinity to true and other values to false." #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `detect_negative` | `IntegerAttr` | 64-bit integer attribute attribute | -| `detect_positive` | `IntegerAttr` | 64-bit integer attribute attribute | +`detect_negative` | IntegerAttr | 64-bit signless integer attribute +`detect_positive` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.IsNaN (ONNXIsNaNOp) -ONNX IsNaN operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.IsNaN` (ONNXIsNaNOp) + +ONNX IsNaN operation "Returns which elements of the input are NaN." #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.LRN (ONNXLRNOp) -ONNX LRN operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.LRN` (ONNXLRNOp) +ONNX LRN operation "Local Response Normalization proposed in the [AlexNet paper](https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf)." "It normalizes over local input regions." @@ -1847,28 +1857,30 @@ ONNX LRN operation "" "Y[n, c, d1, ..., dk] = X[n, c, d1, ..., dk] / (bias + alpha / size * square_sum[n, c, d1, ..., dk] ) ^ beta" -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `alpha` | `FloatAttr` | 32-bit float attribute attribute | -| `beta` | `FloatAttr` | 32-bit float attribute attribute | -| `bias` | `FloatAttr` | 32-bit float attribute attribute | -| `size` | `IntegerAttr` | 64-bit integer attribute attribute | +`alpha` | FloatAttr | 32-bit float attribute +`beta` | FloatAttr | 32-bit float attribute +`bias` | FloatAttr | 32-bit float attribute +`size` | IntegerAttr | 64-bit signless integer attribute + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -### onnx.LSTM (ONNXLSTMOp) -ONNX LSTM operation - -#### Description: +### `onnx.LSTM` (ONNXLSTMOp) +ONNX LSTM operation "Computes an one-layer LSTM. This operator is usually supported via some" "custom implementation such as CuDNN." @@ -1952,64 +1964,68 @@ ONNX LSTM operation " - Ht = ot (.) h(Ct)" "This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `W`: memref of any type values or tensor of any type values -1. `R`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values or none type -1. `sequence_lens`: memref of any type values or tensor of any type values or none type -1. `initial_h`: memref of any type values or tensor of any type values or none type -1. `initial_c`: memref of any type values or tensor of any type values or none type -1. `P`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `activation_alpha` | `ArrayAttr` | 32-bit float array attribute attribute | -| `activation_beta` | `ArrayAttr` | 32-bit float array attribute attribute | -| `activations` | `ArrayAttr` | string array attribute attribute | -| `clip` | `FloatAttr` | 32-bit float attribute attribute | -| `direction` | `StringAttr` | string attribute attribute | -| `hidden_size` | `IntegerAttr` | 64-bit integer attribute attribute | -| `input_forget` | `IntegerAttr` | 64-bit integer attribute attribute | +`activation_alpha` | ArrayAttr | 32-bit float array attribute +`activation_beta` | ArrayAttr | 32-bit float array attribute +`activations` | ArrayAttr | string array attribute +`clip` | FloatAttr | 32-bit float attribute +`direction` | StringAttr | string attribute +`hidden_size` | IntegerAttr | 64-bit signless integer attribute +`input_forget` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values or none type -1. `Y_h`: memref of any type values or tensor of any type values or none type -1. `Y_c`: memref of any type values or tensor of any type values or none type +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`W` | memref of any type values or tensor of any type values +`R` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values or none type +`sequence_lens` | memref of any type values or tensor of any type values or none type +`initial_h` | memref of any type values or tensor of any type values or none type +`initial_c` | memref of any type values or tensor of any type values or none type +`P` | memref of any type values or tensor of any type values or none type -### onnx.LeakyRelu (ONNXLeakyReluOp) -ONNX LeakyRelu operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values or none type +`Y_h` | memref of any type values or tensor of any type values or none type +`Y_c` | memref of any type values or tensor of any type values or none type +### `onnx.LeakyRelu` (ONNXLeakyReluOp) + +ONNX LeakyRelu operation "LeakyRelu takes input data (Tensor) and an argument alpha, and produces one" "output data (Tensor) where the function `f(x) = alpha * x for x < 0`," "`f(x) = x for x >= 0`, is applied to the data tensor elementwise." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `alpha` | `FloatAttr` | 32-bit float attribute attribute | +`alpha` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.Less (ONNXLessOp) -ONNX Less operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Less` (ONNXLessOp) +ONNX Less operation "Returns the tensor resulted from performing the `less` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." @@ -2018,40 +2034,38 @@ ONNX Less operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -### onnx.Log (ONNXLogOp) -ONNX Log operation - -#### Description: +### `onnx.Log` (ONNXLogOp) +ONNX Log operation "Calculates the natural log of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.LogSoftmax (ONNXLogSoftmaxOp) -ONNX LogSoftmax operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.LogSoftmax` (ONNXLogSoftmaxOp) +ONNX LogSoftmax operation "The operator computes the logsoftmax (log of softmax) values for each layer in the batch" " of the given input." @@ -2068,25 +2082,27 @@ ONNX LogSoftmax operation "will throw errors. The output tensor has the same shape" "and contains the logsoftmax values of the corresponding input." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Loop (ONNXLoopOp) -ONNX Loop operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Loop` (ONNXLoopOp) + +ONNX Loop operation "Generic Looping construct. This loop has multiple termination conditions:" "" @@ -2202,50 +2218,54 @@ ONNX Loop operation "the scan_outputs from the previous layer, possibly going through several" "point-wise operators (e.g. dropout, residual connections, linear layer)." -#### Operands: - -1. `M`: memref of any type values or tensor of any type values or none type -1. `cond`: memref of any type values or tensor of any type values or none type -1. `v_initial`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `body` | `Attribute` | any attribute attribute | - -#### Results: +`body` | Attribute | any attribute -1. `v_final_and_scan_outputs`: memref of any type values or tensor of any type values +#### Operands: -### onnx.LpNormalization (ONNXLpNormalizationOp) -ONNX LpNormalization operation +| Operand | Description | +| :-----: | ----------- | +`M` | memref of any type values or tensor of any type values or none type +`cond` | memref of any type values or tensor of any type values or none type +`v_initial` | memref of any type values or tensor of any type values -#### Description: +#### Results: +| Result | Description | +| :----: | ----------- | +`v_final_and_scan_outputs` | memref of any type values or tensor of any type values -"Given a matrix, apply Lp-normalization along the provided axis." +### `onnx.LpNormalization` (ONNXLpNormalizationOp) -#### Operands: +ONNX LpNormalization operation -1. `input`: memref of any type values or tensor of any type values +"Given a matrix, apply Lp-normalization along the provided axis." #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `p` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`p` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.LpPool (ONNXLpPoolOp) -ONNX LpPool operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.LpPool` (ONNXLpPoolOp) + +ONNX LpPool operation "LpPool consumes an input tensor X and applies Lp pooling across" " the tensor according to kernel sizes, stride sizes, and pad lengths." @@ -2253,72 +2273,72 @@ ONNX LpPool operation " of the input tensor according to the kernel size and downsampling the" " data into the output tensor Y for further processing." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `p` | `IntegerAttr` | 64-bit integer attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`p` | IntegerAttr | 64-bit signless integer attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.MatMulInteger (ONNXMatMulIntegerOp) -ONNX MatMulInteger operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.MatMulInteger` (ONNXMatMulIntegerOp) +ONNX MatMulInteger operation "Matrix product that behaves like numpy.matmul: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html." "The production MUST never overflow. The accumulation may overflow if and only if in 32 bits." #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values -1. `a_zero_point`: memref of any type values or tensor of any type values or none type -1. `b_zero_point`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values +`a_zero_point` | memref of any type values or tensor of any type values or none type +`b_zero_point` | memref of any type values or tensor of any type values or none type #### Results: -1. `Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -### onnx.MatMul (ONNXMatMulOp) -ONNX MatMul operation - -#### Description: +### `onnx.MatMul` (ONNXMatMulOp) +ONNX MatMul operation "Matrix product that behaves like numpy.matmul: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html" #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Max (ONNXMaxOp) -ONNX Max operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Max` (ONNXMaxOp) +ONNX Max operation "Element-wise max of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." @@ -2326,20 +2346,19 @@ ONNX Max operation #### Operands: -1. `data_0`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data_0` | memref of any type values or tensor of any type values #### Results: -1. `max`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`max` | memref of any type values or tensor of any type values -### onnx.MaxPool (ONNXMaxPoolOp) -ONNX MaxPool operation - -#### Description: +### `onnx.MaxPool` (ONNXMaxPoolOp) +ONNX MaxPool operation "MaxPool consumes an input tensor X and applies max pooling across" " the tensor according to kernel sizes, stride sizes, and pad lengths." @@ -2371,87 +2390,93 @@ ONNX MaxPool operation " The output of each pooling window is maximum number of elements exclude pad." " " -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `ceil_mode` | `IntegerAttr` | 64-bit integer attribute attribute | -| `dilations` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `storage_order` | `IntegerAttr` | 64-bit integer attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`ceil_mode` | IntegerAttr | 64-bit signless integer attribute +`dilations` | ArrayAttr | 64-bit integer array attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`storage_order` | IntegerAttr | 64-bit signless integer attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values -1. `Indices`: memref of any type values or tensor of any type values or none type +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.MaxPoolSingleOut (ONNXMaxPoolSingleOutOp) -ONNX MaxPool operation with a single output. +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +`Indices` | memref of any type values or tensor of any type values or none type +### `onnx.MaxPoolSingleOut` (ONNXMaxPoolSingleOutOp) + +ONNX MaxPool operation with a single output. "ONNX MaxPool operation with a single output." "See ONNXMaxPoolOp for a full description of the MaxPool semantics." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `ceil_mode` | `IntegerAttr` | 64-bit integer attribute attribute | -| `dilations` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `storage_order` | `IntegerAttr` | 64-bit integer attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`ceil_mode` | IntegerAttr | 64-bit signless integer attribute +`dilations` | ArrayAttr | 64-bit integer array attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`storage_order` | IntegerAttr | 64-bit signless integer attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `o_Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.MaxRoiPool (ONNXMaxRoiPoolOp) -ONNX MaxRoiPool operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`o_Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.MaxRoiPool` (ONNXMaxRoiPoolOp) +ONNX MaxRoiPool operation "ROI max pool consumes an input tensor X and region of interests (RoIs) to" " apply max pooling across each RoI, to produce output 4-D tensor of shape" " (num_rois, channels, pooled_shape[0], pooled_shape[1])." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `rois`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `pooled_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `spatial_scale` | `FloatAttr` | 32-bit float attribute attribute | +`pooled_shape` | ArrayAttr | 64-bit integer array attribute +`spatial_scale` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`rois` | memref of any type values or tensor of any type values -### onnx.MaxUnpool (ONNXMaxUnpoolOp) -ONNX MaxUnpool operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.MaxUnpool` (ONNXMaxUnpoolOp) + +ONNX MaxUnpool operation "MaxUnpool essentially computes the partial inverse of the MaxPool op." " The input information to this op is typically the the output information from a MaxPool op. The first" @@ -2472,29 +2497,31 @@ ONNX MaxUnpool operation " which define the exact unpooling op. The attributes typically have the same values as the corrsponding" " pooling op that the unpooling op is trying to invert." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `I`: memref of any type values or tensor of any type values -1. `output_shape`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`I` | memref of any type values or tensor of any type values +`output_shape` | memref of any type values or tensor of any type values or none type -### onnx.Mean (ONNXMeanOp) -ONNX Mean operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Mean` (ONNXMeanOp) +ONNX Mean operation "Element-wise mean of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." @@ -2502,43 +2529,44 @@ ONNX Mean operation #### Operands: -1. `data_0`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data_0` | memref of any type values or tensor of any type values #### Results: -1. `mean`: memref of any type values or tensor of any type values - -### onnx.MeanVarianceNormalization (ONNXMeanVarianceNormalizationOp) -ONNX MeanVarianceNormalization operation +| Result | Description | +| :----: | ----------- | +`mean` | memref of any type values or tensor of any type values -#### Description: +### `onnx.MeanVarianceNormalization` (ONNXMeanVarianceNormalizationOp) +ONNX MeanVarianceNormalization operation "A MeanVarianceNormalization Function: Perform mean variance normalization" " on the input tensor X using formula:
``` (X-EX)/sqrt(E(X-EX)^2) ```" -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.Min (ONNXMinOp) -ONNX Min operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.Min` (ONNXMinOp) + +ONNX Min operation "Element-wise min of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." @@ -2546,20 +2574,19 @@ ONNX Min operation #### Operands: -1. `data_0`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data_0` | memref of any type values or tensor of any type values #### Results: -1. `min`: memref of any type values or tensor of any type values - -### onnx.Mod (ONNXModOp) -ONNX Mod operation +| Result | Description | +| :----: | ----------- | +`min` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Mod` (ONNXModOp) +ONNX Mod operation "Performs element-wise binary modulus (with Numpy-style broadcasting support). " " The sign of the remainder is the same as that of the Divisor." @@ -2575,26 +2602,28 @@ ONNX Mod operation "" " This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md)." -#### Operands: - -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `fmod` | `IntegerAttr` | 64-bit integer attribute attribute | +`fmod` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `C`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values -### onnx.Mul (ONNXMulOp) -ONNX Mul operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Mul` (ONNXMulOp) +ONNX Mul operation "Performs element-wise binary multiplication (with Numpy-style broadcasting support)." "" @@ -2602,46 +2631,47 @@ ONNX Mul operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -### onnx.Multinomial (ONNXMultinomialOp) -ONNX Multinomial operation - -#### Description: +### `onnx.Multinomial` (ONNXMultinomialOp) +ONNX Multinomial operation "Generate a tensor of samples from a multinomial distribution according to the probabilities" "of each of the possible outcomes." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `dtype` | `IntegerAttr` | 64-bit integer attribute attribute | -| `sample_size` | `IntegerAttr` | 64-bit integer attribute attribute | -| `seed` | `FloatAttr` | 32-bit float attribute attribute | +`dtype` | IntegerAttr | 64-bit signless integer attribute +`sample_size` | IntegerAttr | 64-bit signless integer attribute +`seed` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Neg (ONNXNegOp) -ONNX Neg operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Neg` (ONNXNegOp) + +ONNX Neg operation "Neg takes one input data (Tensor) and produces one output data" "(Tensor) where each element flipped sign, y = -x, is applied to" @@ -2649,20 +2679,19 @@ ONNX Neg operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.NonMaxSuppression (ONNXNonMaxSuppressionOp) -ONNX NonMaxSuppression operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.NonMaxSuppression` (ONNXNonMaxSuppressionOp) +ONNX NonMaxSuppression operation "Filter out boxes that have high intersection-over-union (IOU) overlap with previously selected boxes." "Bounding boxes with score less than score_threshold are removed. Bounding box format is indicated by attribute center_point_box." @@ -2672,29 +2701,31 @@ ONNX NonMaxSuppression operation "The selected_indices output is a set of integers indexing into the input collection of bounding boxes representing the selected boxes." "The bounding box coordinates corresponding to the selected indices can then be obtained using the Gather or GatherND operation." -#### Operands: - -1. `boxes`: memref of any type values or tensor of any type values -1. `scores`: memref of any type values or tensor of any type values -1. `max_output_boxes_per_class`: memref of any type values or tensor of any type values or none type -1. `iou_threshold`: memref of any type values or tensor of any type values or none type -1. `score_threshold`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `center_point_box` | `IntegerAttr` | 64-bit integer attribute attribute | +`center_point_box` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `selected_indices`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`boxes` | memref of any type values or tensor of any type values +`scores` | memref of any type values or tensor of any type values +`max_output_boxes_per_class` | memref of any type values or tensor of any type values or none type +`iou_threshold` | memref of any type values or tensor of any type values or none type +`score_threshold` | memref of any type values or tensor of any type values or none type -### onnx.NonZero (ONNXNonZeroOp) -ONNX NonZero operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`selected_indices` | memref of any type values or tensor of any type values -#### Description: +### `onnx.NonZero` (ONNXNonZeroOp) +ONNX NonZero operation "Returns the indices of the elements that are non-zero" " (in row-major order - by dimension)." @@ -2703,39 +2734,37 @@ ONNX NonZero operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Not (ONNXNotOp) -ONNX Not operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Not` (ONNXNotOp) +ONNX Not operation "Returns the negation of the input tensor element-wise." #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -### onnx.OneHot (ONNXOneHotOp) -ONNX OneHot operation - -#### Description: +### `onnx.OneHot` (ONNXOneHotOp) +ONNX OneHot operation "Produces a one-hot tensor based on inputs." " The locations represented by the index values in the 'indices' input tensor will have 'on_value'" @@ -2757,27 +2786,29 @@ ONNX OneHot operation " output[i, j, k, input[i, j, k]] = 1 for all i, j, k and 0 otherwise." "" -#### Operands: - -1. `indices`: memref of any type values or tensor of any type values -1. `depth`: memref of any type values or tensor of any type values -1. `values`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`indices` | memref of any type values or tensor of any type values +`depth` | memref of any type values or tensor of any type values +`values` | memref of any type values or tensor of any type values -### onnx.Or (ONNXOrOp) -ONNX Or operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Or` (ONNXOrOp) + +ONNX Or operation "Returns the tensor resulted from performing the `or` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." @@ -2786,21 +2817,20 @@ ONNX Or operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values - -### onnx.PRelu (ONNXPReluOp) -ONNX PRelu operation +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -#### Description: +### `onnx.PRelu` (ONNXPReluOp) +ONNX PRelu operation "PRelu takes input data (Tensor) and slope tensor as input, and produces one" "output data (Tensor) where the function `f(x) = slope * x for x < 0`," @@ -2809,47 +2839,48 @@ ONNX PRelu operation #### Operands: -1. `X`: memref of any type values or tensor of any type values -1. `slope`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`slope` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.PadConstantPad (ONNXPadConstantPadOp) -ONNX Pad operation with constant padding value +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.PadConstantPad` (ONNXPadConstantPadOp) +ONNX Pad operation with constant padding value "this operation is introduced to handle situation" " in which the padding value and padding are constants" "They will become attributes." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values -1. `constant_value`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `mode` | `StringAttr` | string attribute attribute | +`pads` | ArrayAttr | 64-bit integer array attribute +`mode` | StringAttr | string attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`constant_value` | memref of any type values or tensor of any type values -### onnx.PadConstantValue (ONNXPadConstantValueOp) -ONNX Pad operation with constant padding value +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.PadConstantValue` (ONNXPadConstantValueOp) +ONNX Pad operation with constant padding value "this operation is introduced to handle situation" " in which the padding value is a constant. @@ -2857,53 +2888,57 @@ ONNX Pad operation with constant padding value "This operation is also used to handle the optional value input is missing and the default value 0." "is used." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values -1. `pads`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `constant_value` | `FloatAttr` | 32-bit float attribute attribute | -| `mode` | `StringAttr` | string attribute attribute | +`constant_value` | FloatAttr | 32-bit float attribute +`mode` | StringAttr | string attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`pads` | memref of any type values or tensor of any type values -### onnx.PadConstantValuePad (ONNXPadConstantValuePadOp) -ONNX Pad operation with constant padding value +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.PadConstantValuePad` (ONNXPadConstantValuePadOp) + +ONNX Pad operation with constant padding value "this operation is introduced to handle situation" " in which the padding value and padding are constants" "They will become attributes." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `constant_value` | `FloatAttr` | 32-bit float attribute attribute | -| `mode` | `StringAttr` | string attribute attribute | +`pads` | ArrayAttr | 64-bit integer array attribute +`constant_value` | FloatAttr | 32-bit float attribute +`mode` | StringAttr | string attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.Pad (ONNXPadOp) -ONNX Pad operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Pad` (ONNXPadOp) +ONNX Pad operation "Given a tensor containing the data to be padded (`data`), a tensor containing the number of start and end pad values for axis (`pads`), (optionally) a `mode`, and (optionally) `constant_value`, " "a padded tensor (`output`) is generated." @@ -2987,27 +3022,29 @@ ONNX Pad operation " ]" "" -#### Operands: - -1. `data`: memref of any type values or tensor of any type values -1. `pads`: memref of any type values or tensor of any type values -1. `constant_value`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `mode` | `StringAttr` | string attribute attribute | +`mode` | StringAttr | string attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`pads` | memref of any type values or tensor of any type values +`constant_value` | memref of any type values or tensor of any type values or none type -### onnx.Pow (ONNXPowOp) -ONNX Pow operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Pow` (ONNXPowOp) + +ONNX Pow operation "Pow takes input data (Tensor) and exponent Tensor, and" "produces one output data (Tensor) where the function `f(x) = x^exponent`," @@ -3016,21 +3053,20 @@ ONNX Pow operation #### Operands: -1. `X`: memref of any type values or tensor of any type values -1. `Y`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`Y` | memref of any type values or tensor of any type values #### Results: -1. `Z`: memref of any type values or tensor of any type values - -### onnx.QLinearConv (ONNXQLinearConvOp) -ONNX QLinearConv operation +| Result | Description | +| :----: | ----------- | +`Z` | memref of any type values or tensor of any type values -#### Description: +### `onnx.QLinearConv` (ONNXQLinearConvOp) +ONNX QLinearConv operation "The convolution operator consumes a quantized input tensor, its scale and zero point," "a quantized filter, its scale and zero point, and output's scale and zero point," @@ -3038,38 +3074,40 @@ ONNX QLinearConv operation "It means they must be either scalars (per tensor) or 1-D tensors (per output channel)." "Each input or output and its related zero point must have same type." -#### Operands: - -1. `x`: memref of any type values or tensor of any type values -1. `x_scale`: memref of any type values or tensor of any type values -1. `x_zero_point`: memref of any type values or tensor of any type values -1. `w`: memref of any type values or tensor of any type values -1. `w_scale`: memref of any type values or tensor of any type values -1. `w_zero_point`: memref of any type values or tensor of any type values -1. `y_scale`: memref of any type values or tensor of any type values -1. `y_zero_point`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `auto_pad` | `StringAttr` | string attribute attribute | -| `dilations` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `group` | `IntegerAttr` | 64-bit integer attribute attribute | -| `kernel_shape` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pads` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `strides` | `ArrayAttr` | 64-bit integer array attribute attribute | +`auto_pad` | StringAttr | string attribute +`dilations` | ArrayAttr | 64-bit integer array attribute +`group` | IntegerAttr | 64-bit signless integer attribute +`kernel_shape` | ArrayAttr | 64-bit integer array attribute +`pads` | ArrayAttr | 64-bit integer array attribute +`strides` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`x` | memref of any type values or tensor of any type values +`x_scale` | memref of any type values or tensor of any type values +`x_zero_point` | memref of any type values or tensor of any type values +`w` | memref of any type values or tensor of any type values +`w_scale` | memref of any type values or tensor of any type values +`w_zero_point` | memref of any type values or tensor of any type values +`y_scale` | memref of any type values or tensor of any type values +`y_zero_point` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values or none type -### onnx.QLinearMatMul (ONNXQLinearMatMulOp) -ONNX QLinearMatMul operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.QLinearMatMul` (ONNXQLinearMatMulOp) +ONNX QLinearMatMul operation "Matrix product that behaves like numpy.matmul: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html." "It consumes two quantized input tensors, their scales and zero points, scale and zero point of output, and computes the quantized output." @@ -3082,27 +3120,26 @@ ONNX QLinearMatMul operation #### Operands: -1. `a`: memref of any type values or tensor of any type values -1. `a_scale`: memref of any type values or tensor of any type values -1. `a_zero_point`: memref of any type values or tensor of any type values -1. `b`: memref of any type values or tensor of any type values -1. `b_scale`: memref of any type values or tensor of any type values -1. `b_zero_point`: memref of any type values or tensor of any type values -1. `y_scale`: memref of any type values or tensor of any type values -1. `y_zero_point`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`a` | memref of any type values or tensor of any type values +`a_scale` | memref of any type values or tensor of any type values +`a_zero_point` | memref of any type values or tensor of any type values +`b` | memref of any type values or tensor of any type values +`b_scale` | memref of any type values or tensor of any type values +`b_zero_point` | memref of any type values or tensor of any type values +`y_scale` | memref of any type values or tensor of any type values +`y_zero_point` | memref of any type values or tensor of any type values #### Results: -1. `y`: memref of any type values or tensor of any type values - -### onnx.QuantizeLinear (ONNXQuantizeLinearOp) -ONNX QuantizeLinear operation +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.QuantizeLinear` (ONNXQuantizeLinearOp) +ONNX QuantizeLinear operation "The linear per-tensor/layer quantization operator. It consumes a high precision tensor, a scale, a zero point to compute the low precision / quantized tensor." "The quantization formula is y = saturate ((x / y_scale) + y_zero_point). For saturation, it saturates to [0, 255] if it's uint8, or [-128, 127] if it's int8." @@ -3110,22 +3147,21 @@ ONNX QuantizeLinear operation #### Operands: -1. `x`: memref of any type values or tensor of any type values -1. `y_scale`: memref of any type values or tensor of any type values -1. `y_zero_point`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`x` | memref of any type values or tensor of any type values +`y_scale` | memref of any type values or tensor of any type values +`y_zero_point` | memref of any type values or tensor of any type values or none type #### Results: -1. `y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values -### onnx.RNN (ONNXRNNOp) -ONNX RNN operation - -#### Description: +### `onnx.RNN` (ONNXRNNOp) +ONNX RNN operation "Computes an one-layer simple RNN. This operator is usually supported" "via some custom implementation such as CuDNN." @@ -3189,36 +3225,38 @@ ONNX RNN operation " - Ht = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Wbi + Rbi)" "This operator has **optional** inputs/outputs. See [the doc](IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `W`: memref of any type values or tensor of any type values -1. `R`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values or none type -1. `sequence_lens`: memref of any type values or tensor of any type values or none type -1. `initial_h`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `activation_alpha` | `ArrayAttr` | 32-bit float array attribute attribute | -| `activation_beta` | `ArrayAttr` | 32-bit float array attribute attribute | -| `activations` | `ArrayAttr` | string array attribute attribute | -| `clip` | `FloatAttr` | 32-bit float attribute attribute | -| `direction` | `StringAttr` | string attribute attribute | -| `hidden_size` | `IntegerAttr` | 64-bit integer attribute attribute | +`activation_alpha` | ArrayAttr | 32-bit float array attribute +`activation_beta` | ArrayAttr | 32-bit float array attribute +`activations` | ArrayAttr | string array attribute +`clip` | FloatAttr | 32-bit float attribute +`direction` | StringAttr | string attribute +`hidden_size` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values or none type -1. `Y_h`: memref of any type values or tensor of any type values or none type +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`W` | memref of any type values or tensor of any type values +`R` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values or none type +`sequence_lens` | memref of any type values or tensor of any type values or none type +`initial_h` | memref of any type values or tensor of any type values or none type -### onnx.RandomNormalLike (ONNXRandomNormalLikeOp) -ONNX RandomNormalLike operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values or none type +`Y_h` | memref of any type values or tensor of any type values or none type +### `onnx.RandomNormalLike` (ONNXRandomNormalLikeOp) + +ONNX RandomNormalLike operation "Generate a tensor with random values drawn from a normal distribution." "The shape of the output tensor is copied from the shape of the input tensor," @@ -3228,28 +3266,30 @@ ONNX RandomNormalLike operation "The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the" "TensorProto message, and be valid as an output type." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `dtype` | `IntegerAttr` | 64-bit integer attribute attribute | -| `mean` | `FloatAttr` | 32-bit float attribute attribute | -| `scale` | `FloatAttr` | 32-bit float attribute attribute | -| `seed` | `FloatAttr` | 32-bit float attribute attribute | +`dtype` | IntegerAttr | 64-bit signless integer attribute +`mean` | FloatAttr | 32-bit float attribute +`scale` | FloatAttr | 32-bit float attribute +`seed` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.RandomNormal (ONNXRandomNormalOp) -ONNX RandomNormal operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.RandomNormal` (ONNXRandomNormalOp) +ONNX RandomNormal operation "Generate a tensor with random values drawn from a normal distribution. The shape" "of the tensor is specified by the `shape` argument and the parameter of the normal distribution" @@ -3259,28 +3299,25 @@ ONNX RandomNormal operation "be one of the data types specified in the 'DataType' enum field in the" "TensorProto message." -#### Operands: - - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `dtype` | `IntegerAttr` | 64-bit integer attribute attribute | -| `mean` | `FloatAttr` | 32-bit float attribute attribute | -| `scale` | `FloatAttr` | 32-bit float attribute attribute | -| `seed` | `FloatAttr` | 32-bit float attribute attribute | -| `shape` | `ArrayAttr` | 64-bit integer array attribute attribute | +`dtype` | IntegerAttr | 64-bit signless integer attribute +`mean` | FloatAttr | 32-bit float attribute +`scale` | FloatAttr | 32-bit float attribute +`seed` | FloatAttr | 32-bit float attribute +`shape` | ArrayAttr | 64-bit integer array attribute #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.RandomUniformLike (ONNXRandomUniformLikeOp) -ONNX RandomUniformLike operation - -#### Description: +### `onnx.RandomUniformLike` (ONNXRandomUniformLikeOp) +ONNX RandomUniformLike operation "Generate a tensor with random values drawn from a uniform distribution." "The shape of the output tensor is copied from the shape of the input tensor," @@ -3290,28 +3327,30 @@ ONNX RandomUniformLike operation "The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the" "TensorProto message and be valid as an output type." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `dtype` | `IntegerAttr` | 64-bit integer attribute attribute | -| `high` | `FloatAttr` | 32-bit float attribute attribute | -| `low` | `FloatAttr` | 32-bit float attribute attribute | -| `seed` | `FloatAttr` | 32-bit float attribute attribute | +`dtype` | IntegerAttr | 64-bit signless integer attribute +`high` | FloatAttr | 32-bit float attribute +`low` | FloatAttr | 32-bit float attribute +`seed` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.RandomUniform (ONNXRandomUniformOp) -ONNX RandomUniform operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.RandomUniform` (ONNXRandomUniformOp) + +ONNX RandomUniform operation "Generate a tensor with random values drawn from a uniform distribution. The shape" "of the tensor is specified by the `shape` argument and the range by `low` and `high`." @@ -3320,28 +3359,25 @@ ONNX RandomUniform operation "be one of the data types specified in the 'DataType' enum field in the" "TensorProto message." -#### Operands: - - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `dtype` | `IntegerAttr` | 64-bit integer attribute attribute | -| `high` | `FloatAttr` | 32-bit float attribute attribute | -| `low` | `FloatAttr` | 32-bit float attribute attribute | -| `seed` | `FloatAttr` | 32-bit float attribute attribute | -| `shape` | `ArrayAttr` | 64-bit integer array attribute attribute | +`dtype` | IntegerAttr | 64-bit signless integer attribute +`high` | FloatAttr | 32-bit float attribute +`low` | FloatAttr | 32-bit float attribute +`seed` | FloatAttr | 32-bit float attribute +`shape` | ArrayAttr | 64-bit integer array attribute #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Range (ONNXRangeOp) -ONNX Range operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Range` (ONNXRangeOp) +ONNX Range operation "Generate a tensor containing a sequence of numbers that begin at `start` and extends by increments of `delta` " "up to `limit` (exclusive)." @@ -3371,22 +3407,21 @@ ONNX Range operation #### Operands: -1. `start`: memref of any type values or tensor of any type values -1. `limit`: memref of any type values or tensor of any type values -1. `delta`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`start` | memref of any type values or tensor of any type values +`limit` | memref of any type values or tensor of any type values +`delta` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Reciprocal (ONNXReciprocalOp) -ONNX Reciprocal operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Reciprocal` (ONNXReciprocalOp) +ONNX Reciprocal operation "Reciprocal takes one input data (Tensor) and produces one output data" "(Tensor) where the reciprocal is, y = 1/x, is applied to" @@ -3394,20 +3429,19 @@ ONNX Reciprocal operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.ReduceL1 (ONNXReduceL1Op) -ONNX ReduceL1 operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ReduceL1` (ONNXReduceL1Op) +ONNX ReduceL1 operation "Computes the L1 norm of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3416,26 +3450,28 @@ ONNX ReduceL1 operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceL2 (ONNXReduceL2Op) -ONNX ReduceL2 operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ReduceL2` (ONNXReduceL2Op) +ONNX ReduceL2 operation "Computes the L2 norm of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3444,26 +3480,28 @@ ONNX ReduceL2 operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceLogSumExp (ONNXReduceLogSumExpOp) -ONNX ReduceLogSumExp operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values +### `onnx.ReduceLogSumExp` (ONNXReduceLogSumExpOp) + +ONNX ReduceLogSumExp operation "Computes the log sum exponent of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3472,26 +3510,28 @@ ONNX ReduceLogSumExp operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceLogSum (ONNXReduceLogSumOp) -ONNX ReduceLogSum operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ReduceLogSum` (ONNXReduceLogSumOp) +ONNX ReduceLogSum operation "Computes the log sum of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3500,26 +3540,28 @@ ONNX ReduceLogSum operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceMax (ONNXReduceMaxOp) -ONNX ReduceMax operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values +### `onnx.ReduceMax` (ONNXReduceMaxOp) + +ONNX ReduceMax operation "Computes the max of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3528,26 +3570,28 @@ ONNX ReduceMax operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceMean (ONNXReduceMeanOp) -ONNX ReduceMean operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ReduceMean` (ONNXReduceMeanOp) +ONNX ReduceMean operation "Computes the mean of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3556,26 +3600,28 @@ ONNX ReduceMean operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceMin (ONNXReduceMinOp) -ONNX ReduceMin operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values +### `onnx.ReduceMin` (ONNXReduceMinOp) + +ONNX ReduceMin operation "Computes the min of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3584,26 +3630,28 @@ ONNX ReduceMin operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceProd (ONNXReduceProdOp) -ONNX ReduceProd operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ReduceProd` (ONNXReduceProdOp) +ONNX ReduceProd operation "Computes the product of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3612,26 +3660,28 @@ ONNX ReduceProd operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceSum (ONNXReduceSumOp) -ONNX ReduceSum operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values +### `onnx.ReduceSum` (ONNXReduceSumOp) + +ONNX ReduceSum operation "Computes the sum of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3640,26 +3690,28 @@ ONNX ReduceSum operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.ReduceSumSquare (ONNXReduceSumSquareOp) -ONNX ReduceSumSquare operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ReduceSumSquare` (ONNXReduceSumSquareOp) +ONNX ReduceSumSquare operation "Computes the sum square of the input tensor's element along the provided axes. The resulted" "tensor has the same rank as the input if keepdims equal 1. If keepdims equal 0, then" @@ -3668,26 +3720,28 @@ ONNX ReduceSumSquare operation "The above behavior is similar to numpy, with the exception that numpy default keepdims to" "False instead of True." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `reduced`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.Relu (ONNXReluOp) -ONNX Relu operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values +### `onnx.Relu` (ONNXReluOp) + +ONNX Relu operation "Relu takes one input data (Tensor) and produces one output data" "(Tensor) where the rectified linear function, y = max(0, x), is applied to" @@ -3695,20 +3749,19 @@ ONNX Relu operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Reshape (ONNXReshapeOp) -ONNX Reshape operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Reshape` (ONNXReshapeOp) +ONNX Reshape operation "Reshape the input tensor similar to numpy.reshape." "First input is the data tensor, second input is a shape tensor which specifies the output shape. It outputs the reshaped tensor." @@ -3719,53 +3772,54 @@ ONNX Reshape operation #### Operands: -1. `data`: memref of any type values or tensor of any type values -1. `shape`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`shape` | memref of any type values or tensor of any type values or none type #### Results: -1. `reshaped`: memref of any type values or tensor of any type values - -### onnx.Resize (ONNXResizeOp) -ONNX Resize operation +| Result | Description | +| :----: | ----------- | +`reshaped` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Resize` (ONNXResizeOp) +ONNX Resize operation "Resize the input tensor. In general, it calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor." "Each dimension value of the output tensor is:" " output_dimension = floor(input_dimension * (roi_end - roi_start) * scale) if input \\"sizes\\" is not specified." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `roi`: memref of any type values or tensor of any type values -1. `scales`: memref of any type values or tensor of any type values -1. `sizes`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `coordinate_transformation_mode` | `StringAttr` | string attribute attribute | -| `cubic_coeff_a` | `FloatAttr` | 32-bit float attribute attribute | -| `exclude_outside` | `IntegerAttr` | 64-bit integer attribute attribute | -| `extrapolation_value` | `FloatAttr` | 32-bit float attribute attribute | -| `mode` | `StringAttr` | string attribute attribute | -| `nearest_mode` | `StringAttr` | string attribute attribute | +`coordinate_transformation_mode` | StringAttr | string attribute +`cubic_coeff_a` | FloatAttr | 32-bit float attribute +`exclude_outside` | IntegerAttr | 64-bit signless integer attribute +`extrapolation_value` | FloatAttr | 32-bit float attribute +`mode` | StringAttr | string attribute +`nearest_mode` | StringAttr | string attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`roi` | memref of any type values or tensor of any type values +`scales` | memref of any type values or tensor of any type values +`sizes` | memref of any type values or tensor of any type values or none type -### onnx.ReverseSequence (ONNXReverseSequenceOp) -ONNX ReverseSequence operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ReverseSequence` (ONNXReverseSequenceOp) +ONNX ReverseSequence operation "Reverse batch of sequences having different lengths specified by `sequence_lens`." "" @@ -3801,27 +3855,29 @@ ONNX ReverseSequence operation " [10.0, 9.0, 8.0, 11.0]," " [15.0, 14.0, 13.0, 12.0]]" -#### Operands: - -1. `input`: memref of any type values or tensor of any type values -1. `sequence_lens`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `batch_axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `time_axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`batch_axis` | IntegerAttr | 64-bit signless integer attribute +`time_axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values +`sequence_lens` | memref of any type values or tensor of any type values -### onnx.RoiAlign (ONNXRoiAlignOp) -ONNX RoiAlign operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.RoiAlign` (ONNXRoiAlignOp) + +ONNX RoiAlign operation "Region of Interest (RoI) align operation described in the" "[Mask R-CNN paper](https://arxiv.org/abs/1703.06870)." @@ -3835,31 +3891,33 @@ ONNX RoiAlign operation "the value of the sampled locations are computed directly" "through bilinear interpolation." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `rois`: memref of any type values or tensor of any type values -1. `batch_indices`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `mode` | `StringAttr` | string attribute attribute | -| `output_height` | `IntegerAttr` | 64-bit integer attribute attribute | -| `output_width` | `IntegerAttr` | 64-bit integer attribute attribute | -| `sampling_ratio` | `IntegerAttr` | 64-bit integer attribute attribute | -| `spatial_scale` | `FloatAttr` | 32-bit float attribute attribute | +`mode` | StringAttr | string attribute +`output_height` | IntegerAttr | 64-bit signless integer attribute +`output_width` | IntegerAttr | 64-bit signless integer attribute +`sampling_ratio` | IntegerAttr | 64-bit signless integer attribute +`spatial_scale` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`rois` | memref of any type values or tensor of any type values +`batch_indices` | memref of any type values or tensor of any type values -### onnx.Round (ONNXRoundOp) -ONNX Round operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Round` (ONNXRoundOp) +ONNX Round operation "Round takes one input Tensor and rounds the values, element-wise, meaning" "it finds the nearest integer for each value." @@ -3877,20 +3935,19 @@ ONNX Round operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Scan (ONNXScanOp) -ONNX Scan operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Scan` (ONNXScanOp) +ONNX Scan operation "Scan can be used to iterate over one or more scan_input tensors," "constructing zero or more scan_output tensors. It combines ideas from general recurrences," @@ -4014,30 +4071,32 @@ ONNX Scan operation " }" "" -#### Operands: - -1. `initial_state_and_scan_inputs`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `body` | `Attribute` | any attribute attribute | -| `num_scan_inputs` | `IntegerAttr` | 64-bit integer attribute attribute | -| `scan_input_axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `scan_input_directions` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `scan_output_axes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `scan_output_directions` | `ArrayAttr` | 64-bit integer array attribute attribute | +`body` | Attribute | any attribute +`num_scan_inputs` | IntegerAttr | 64-bit signless integer attribute +`scan_input_axes` | ArrayAttr | 64-bit integer array attribute +`scan_input_directions` | ArrayAttr | 64-bit integer array attribute +`scan_output_axes` | ArrayAttr | 64-bit integer array attribute +`scan_output_directions` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `final_state_and_scan_outputs`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`initial_state_and_scan_inputs` | memref of any type values or tensor of any type values -### onnx.ScatterElements (ONNXScatterElementsOp) -ONNX ScatterElements operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`final_state_and_scan_outputs` | memref of any type values or tensor of any type values +### `onnx.ScatterElements` (ONNXScatterElementsOp) + +ONNX ScatterElements operation "ScatterElements takes three inputs `data`, `updates`, and `indices` of the same" "rank r >= 1 and an optional attribute axis that identifies an axis of `data`" @@ -4091,27 +4150,29 @@ ONNX ScatterElements operation " output = [[1.0, 1.1, 3.0, 2.1, 5.0]]" "```" -#### Operands: - -1. `data`: memref of any type values or tensor of any type values -1. `indices`: memref of any type values or tensor of any type values -1. `updates`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`indices` | memref of any type values or tensor of any type values +`updates` | memref of any type values or tensor of any type values -### onnx.ScatterND (ONNXScatterNDOp) -ONNX ScatterND operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ScatterND` (ONNXScatterNDOp) +ONNX ScatterND operation "ScatterND takes three inputs `data` tensor of rank r >= 1, `indices` tensor of rank q >= 1," "and `updates` tensor of rank q + r - indices.shape[-1] - 1. The output of the operation" @@ -4172,22 +4233,21 @@ ONNX ScatterND operation #### Operands: -1. `data`: memref of any type values or tensor of any type values -1. `indices`: memref of any type values or tensor of any type values -1. `updates`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`indices` | memref of any type values or tensor of any type values +`updates` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Scatter (ONNXScatterOp) -ONNX Scatter operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Scatter` (ONNXScatterOp) +ONNX Scatter operation "This operator is deprecated. Please use ScatterElements, which provides the same functionality." "" @@ -4243,53 +4303,57 @@ ONNX Scatter operation " output = [[1.0, 1.1, 3.0, 2.1, 5.0]]" "```" -#### Operands: - -1. `data`: memref of any type values or tensor of any type values -1. `indices`: memref of any type values or tensor of any type values -1. `updates`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`indices` | memref of any type values or tensor of any type values +`updates` | memref of any type values or tensor of any type values -### onnx.Selu (ONNXSeluOp) -ONNX Selu operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Selu` (ONNXSeluOp) + +ONNX Selu operation "Selu takes one input data (Tensor) and produces one output data" "(Tensor) where the scaled exponential linear unit function," "`y = gamma * (alpha * e^x - alpha) for x <= 0`, `y = gamma * x for x > 0`," "is applied to the tensor elementwise." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `alpha` | `FloatAttr` | 32-bit float attribute attribute | -| `gamma` | `FloatAttr` | 32-bit float attribute attribute | +`alpha` | FloatAttr | 32-bit float attribute +`gamma` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.SequenceAt (ONNXSequenceAtOp) -ONNX SequenceAt operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.SequenceAt` (ONNXSequenceAtOp) +ONNX SequenceAt operation "Outputs a tensor copy from the tensor at 'position' in 'input_sequence'." "Accepted range for 'position' is in `[-n, n - 1]`, where `n` is the number of tensors in 'input_sequence'." @@ -4297,62 +4361,57 @@ ONNX SequenceAt operation #### Operands: -1. `input_sequence`: memref of any type values or tensor of any type values -1. `position`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input_sequence` | memref of any type values or tensor of any type values +`position` | memref of any type values or tensor of any type values #### Results: -1. `tensor`: memref of any type values or tensor of any type values - -### onnx.SequenceConstruct (ONNXSequenceConstructOp) -ONNX SequenceConstruct operation +| Result | Description | +| :----: | ----------- | +`tensor` | memref of any type values or tensor of any type values -#### Description: +### `onnx.SequenceConstruct` (ONNXSequenceConstructOp) +ONNX SequenceConstruct operation "Construct a tensor sequence containing 'inputs' tensors." "All tensors in 'inputs' must have the same data type." #### Operands: -1. `inputs`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`inputs` | memref of any type values or tensor of any type values #### Results: -1. `output_sequence`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output_sequence` | memref of any type values or tensor of any type values -### onnx.SequenceEmpty (ONNXSequenceEmptyOp) -ONNX SequenceEmpty operation - -#### Description: +### `onnx.SequenceEmpty` (ONNXSequenceEmptyOp) +ONNX SequenceEmpty operation "Construct an empty tensor sequence, with given data type." -#### Operands: - - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `dtype` | `IntegerAttr` | 64-bit integer attribute attribute | +`dtype` | IntegerAttr | 64-bit signless integer attribute #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.SequenceErase (ONNXSequenceEraseOp) -ONNX SequenceErase operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.SequenceErase` (ONNXSequenceEraseOp) +ONNX SequenceErase operation "Outputs a tensor sequence that removes the tensor at 'position' from 'input_sequence'." "Accepted range for 'position' is in `[-n, n - 1]`, where `n` is the number of tensors in 'input_sequence'." @@ -4361,21 +4420,20 @@ ONNX SequenceErase operation #### Operands: -1. `input_sequence`: memref of any type values or tensor of any type values -1. `position`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input_sequence` | memref of any type values or tensor of any type values +`position` | memref of any type values or tensor of any type values or none type #### Results: -1. `output_sequence`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output_sequence` | memref of any type values or tensor of any type values -### onnx.SequenceInsert (ONNXSequenceInsertOp) -ONNX SequenceInsert operation - -#### Description: +### `onnx.SequenceInsert` (ONNXSequenceInsertOp) +ONNX SequenceInsert operation "Outputs a tensor sequence that inserts 'tensor' into 'input_sequence' at 'position'." "'tensor' must have the same data type as 'input_sequence'." @@ -4385,86 +4443,85 @@ ONNX SequenceInsert operation #### Operands: -1. `input_sequence`: memref of any type values or tensor of any type values -1. `tensor`: memref of any type values or tensor of any type values -1. `position`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input_sequence` | memref of any type values or tensor of any type values +`tensor` | memref of any type values or tensor of any type values +`position` | memref of any type values or tensor of any type values or none type #### Results: -1. `output_sequence`: memref of any type values or tensor of any type values - -### onnx.SequenceLength (ONNXSequenceLengthOp) -ONNX SequenceLength operation +| Result | Description | +| :----: | ----------- | +`output_sequence` | memref of any type values or tensor of any type values -#### Description: +### `onnx.SequenceLength` (ONNXSequenceLengthOp) +ONNX SequenceLength operation "Produces a scalar(tensor of empty shape) containing the number of tensors in 'input_sequence'." #### Operands: -1. `input_sequence`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input_sequence` | memref of any type values or tensor of any type values #### Results: -1. `length`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`length` | memref of any type values or tensor of any type values -### onnx.Shape (ONNXShapeOp) -ONNX Shape operation - -#### Description: +### `onnx.Shape` (ONNXShapeOp) +ONNX Shape operation "Takes a tensor as input and outputs an 1D int64 tensor containing the shape of the input tensor." #### Operands: -1. `data`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `shape`: memref of any type values or tensor of any type values - -### onnx.Shrink (ONNXShrinkOp) -ONNX Shrink operation +| Result | Description | +| :----: | ----------- | +`shape` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Shrink` (ONNXShrinkOp) +ONNX Shrink operation "Shrink takes one input data (Tensor) and produces one Tensor output," "having same datatype and shape with input. It has two attributes, lambd and" "bias. The formula of this operator is: If x < -lambd, y = x + bias;" "If x > lambd, y = x - bias; Otherwise, y = 0." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `bias` | `FloatAttr` | 32-bit float attribute attribute | -| `lambd` | `FloatAttr` | 32-bit float attribute attribute | +`bias` | FloatAttr | 32-bit float attribute +`lambd` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Sigmoid (ONNXSigmoidOp) -ONNX Sigmoid operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Sigmoid` (ONNXSigmoidOp) + +ONNX Sigmoid operation "Sigmoid takes one input data (Tensor) and produces one output data" "(Tensor) where the sigmoid function, y = 1 / (1 + exp(-x)), is applied to the" @@ -4472,97 +4529,92 @@ ONNX Sigmoid operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Sign (ONNXSignOp) -ONNX Sign operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Sign` (ONNXSignOp) +ONNX Sign operation "Calculate the sign of the given input tensor element-wise." "If input > 0, output 1. if input < 0, output -1. if input == 0, output 0." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Sin (ONNXSinOp) -ONNX Sin operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Sin` (ONNXSinOp) +ONNX Sin operation "Calculates the sine of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Sinh (ONNXSinhOp) -ONNX Sinh operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Sinh` (ONNXSinhOp) +ONNX Sinh operation "Calculates the hyperbolic sine of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Size (ONNXSizeOp) -ONNX Size operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Size` (ONNXSizeOp) +ONNX Size operation "Takes a tensor as input and outputs a int64 scalar that equals to the total number of elements of the input tensor." #### Operands: -1. `data`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `size`: memref of any type values or tensor of any type values - -### onnx.Slice (ONNXSliceOp) -ONNX Slice operation +| Result | Description | +| :----: | ----------- | +`size` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Slice` (ONNXSliceOp) +ONNX Slice operation "Produces a slice of the input tensor along multiple axes. Similar to numpy:" "https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html" @@ -4601,24 +4653,23 @@ ONNX Slice operation #### Operands: -1. `data`: memref of any type values or tensor of any type values -1. `starts`: memref of any type values or tensor of any type values -1. `ends`: memref of any type values or tensor of any type values -1. `axes`: memref of any type values or tensor of any type values or none type -1. `steps`: memref of any type values or tensor of any type values or none type - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values +`starts` | memref of any type values or tensor of any type values +`ends` | memref of any type values or tensor of any type values +`axes` | memref of any type values or tensor of any type values or none type +`steps` | memref of any type values or tensor of any type values or none type #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Softmax (ONNXSoftmaxOp) -ONNX Softmax operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Softmax` (ONNXSoftmaxOp) +ONNX Softmax operation "The operator computes the softmax (normalized exponential) values for each layer in the batch" " of the given input." @@ -4635,25 +4686,27 @@ ONNX Softmax operation "will throw errors. The output tensor has the same shape" "and contains the softmax values of the corresponding input." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Softplus (ONNXSoftplusOp) -ONNX Softplus operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Softplus` (ONNXSoftplusOp) +ONNX Softplus operation "Softplus takes one input data (Tensor) and produces one output data" "(Tensor) where the softplus function, y = ln(exp(x) + 1), is applied to" @@ -4661,88 +4714,90 @@ ONNX Softplus operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Softsign (ONNXSoftsignOp) -ONNX Softsign operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Softsign` (ONNXSoftsignOp) +ONNX Softsign operation "Calculates the softsign (x/(1+|x|)) of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -### onnx.SpaceToDepth (ONNXSpaceToDepthOp) -ONNX SpaceToDepth operation - -#### Description: +### `onnx.SpaceToDepth` (ONNXSpaceToDepthOp) +ONNX SpaceToDepth operation "SpaceToDepth rearranges blocks of spatial data into depth. More specifically," "this op outputs a copy of the input tensor where values from the height and width dimensions" "are moved to the depth dimension." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `blocksize` | `IntegerAttr` | 64-bit integer attribute attribute | +`blocksize` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.Split (ONNXSplitOp) -ONNX Split operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values +### `onnx.Split` (ONNXSplitOp) + +ONNX Split operation "Split a tensor into a list of tensors, along the specified" "'axis'. Lengths of the parts can be specified using argument 'split'." "Otherwise, the tensor is split to equal sized parts." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `split` | `ArrayAttr` | 64-bit integer array attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`split` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `outputs`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values -### onnx.SplitToSequence (ONNXSplitToSequenceOp) -ONNX SplitToSequence operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`outputs` | memref of any type values or tensor of any type values -#### Description: +### `onnx.SplitToSequence` (ONNXSplitToSequenceOp) +ONNX SplitToSequence operation "Split a tensor into a sequence of tensors, along the specified" "'axis'. Lengths of the parts can be specified using argument 'split'." @@ -4755,27 +4810,29 @@ ONNX SplitToSequence operation "specified in 'split'. In this scenario, the sum of entries in 'split' must be equal to the" "dimension size of input tensor on 'axis'." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values -1. `split`: memref of any type values or tensor of any type values or none type - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `keepdims` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`keepdims` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `output_sequence`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values +`split` | memref of any type values or tensor of any type values or none type -### onnx.Sqrt (ONNXSqrtOp) -ONNX Sqrt operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`output_sequence` | memref of any type values or tensor of any type values +### `onnx.Sqrt` (ONNXSqrtOp) + +ONNX Sqrt operation "Square root takes one input data (Tensor) and produces one output data" "(Tensor) where the square root is, y = x^0.5, is applied to" @@ -4783,45 +4840,46 @@ ONNX Sqrt operation #### Operands: -1. `X`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `Y`: memref of any type values or tensor of any type values - -### onnx.Squeeze (ONNXSqueezeOp) -ONNX Squeeze operation +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Squeeze` (ONNXSqueezeOp) +ONNX Squeeze operation "Remove single-dimensional entries from the shape of a tensor." "Takes a parameter `axes` with a list of axes to squeeze." "If `axes` is not provided, all the single dimensions will be removed from" "the shape. If an axis is selected with shape entry not equal to one, an error is raised." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `squeezed`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.StringNormalizer (ONNXStringNormalizerOp) -ONNX StringNormalizer operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`squeezed` | memref of any type values or tensor of any type values -#### Description: +### `onnx.StringNormalizer` (ONNXStringNormalizerOp) +ONNX StringNormalizer operation "StringNormalization performs string operations for basic cleaning." "This operator has only one input (denoted by X) and only one output" @@ -4833,28 +4891,30 @@ ONNX StringNormalizer operation "If all elements in X are dropped, the output will be the empty value of string tensor with shape [1]" "if input shape is [C] and shape [1, 1] if input shape is [1, C]." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `case_change_action` | `StringAttr` | string attribute attribute | -| `is_case_sensitive` | `IntegerAttr` | 64-bit integer attribute attribute | -| `locale` | `StringAttr` | string attribute attribute | -| `stopwords` | `ArrayAttr` | string array attribute attribute | +`case_change_action` | StringAttr | string attribute +`is_case_sensitive` | IntegerAttr | 64-bit signless integer attribute +`locale` | StringAttr | string attribute +`stopwords` | ArrayAttr | string array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.Sub (ONNXSubOp) -ONNX Sub operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.Sub` (ONNXSubOp) + +ONNX Sub operation "Performs element-wise binary subtraction (with Numpy-style broadcasting support)." "" @@ -4862,21 +4922,20 @@ ONNX Sub operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values - -### onnx.Sum (ONNXSumOp) -ONNX Sum operation +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Sum` (ONNXSumOp) +ONNX Sum operation "Element-wise sum of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." @@ -4884,58 +4943,55 @@ ONNX Sum operation #### Operands: -1. `data_0`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`data_0` | memref of any type values or tensor of any type values #### Results: -1. `sum`: memref of any type values or tensor of any type values - -### onnx.Tan (ONNXTanOp) -ONNX Tan operation +| Result | Description | +| :----: | ----------- | +`sum` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Tan` (ONNXTanOp) +ONNX Tan operation "Calculates the tangent of the given input tensor, element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Tanh (ONNXTanhOp) -ONNX Tanh operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Tanh` (ONNXTanhOp) +ONNX Tanh operation "Calculates the hyperbolic tangent of the given input tensor element-wise." #### Operands: -1. `input`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.TfIdfVectorizer (ONNXTfIdfVectorizerOp) -ONNX TfIdfVectorizer operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.TfIdfVectorizer` (ONNXTfIdfVectorizerOp) +ONNX TfIdfVectorizer operation "This transform extracts n-grams from the input sequence and save them as a vector. Input can" "be either a 1-D or 2-D tensor. For 1-D input, output is the n-gram representation of that input." @@ -4965,57 +5021,61 @@ ONNX TfIdfVectorizer operation "Only one of pool_strings and pool_int64s can be set. If pool_int64s is set, the input should be an integer tensor." "If pool_strings is set, the input must be a string tensor." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `max_gram_length` | `IntegerAttr` | 64-bit integer attribute attribute | -| `max_skip_count` | `IntegerAttr` | 64-bit integer attribute attribute | -| `min_gram_length` | `IntegerAttr` | 64-bit integer attribute attribute | -| `mode` | `StringAttr` | string attribute attribute | -| `ngram_counts` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `ngram_indexes` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pool_int64s` | `ArrayAttr` | 64-bit integer array attribute attribute | -| `pool_strings` | `ArrayAttr` | string array attribute attribute | -| `weights` | `ArrayAttr` | 32-bit float array attribute attribute | +`max_gram_length` | IntegerAttr | 64-bit signless integer attribute +`max_skip_count` | IntegerAttr | 64-bit signless integer attribute +`min_gram_length` | IntegerAttr | 64-bit signless integer attribute +`mode` | StringAttr | string attribute +`ngram_counts` | ArrayAttr | 64-bit integer array attribute +`ngram_indexes` | ArrayAttr | 64-bit integer array attribute +`pool_int64s` | ArrayAttr | 64-bit integer array attribute +`pool_strings` | ArrayAttr | string array attribute +`weights` | ArrayAttr | 32-bit float array attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.ThresholdedRelu (ONNXThresholdedReluOp) -ONNX ThresholdedRelu operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.ThresholdedRelu` (ONNXThresholdedReluOp) +ONNX ThresholdedRelu operation "ThresholdedRelu takes one input data (Tensor) and produces one output data" "(Tensor) where the rectified linear function, y = x for x > alpha, y = 0 otherwise," "is applied to the tensor elementwise." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `alpha` | `FloatAttr` | 32-bit float attribute attribute | +`alpha` | FloatAttr | 32-bit float attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.Tile (ONNXTileOp) -ONNX Tile operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +### `onnx.Tile` (ONNXTileOp) + +ONNX Tile operation "Constructs a tensor by tiling a given tensor." "This is the same as function `tile` in Numpy, but no broadcast." @@ -5023,21 +5083,20 @@ ONNX Tile operation #### Operands: -1. `input`: memref of any type values or tensor of any type values -1. `repeats`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values +`repeats` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.TopK (ONNXTopKOp) -ONNX TopK operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.TopK` (ONNXTopKOp) +ONNX TopK operation "Retrieve the top-K largest or smallest elements along a specified axis. Given an input tensor of" "shape [a_1, a_2, ..., a_n, r] and integer argument k, return two outputs:" @@ -5054,53 +5113,57 @@ ONNX TopK operation "Given two equivalent values, this operator uses the indices along the axis as" " a tiebreaker. That is, the element with the lower index will appear first." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `K`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `largest` | `IntegerAttr` | 64-bit integer attribute attribute | -| `sorted` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`largest` | IntegerAttr | 64-bit signless integer attribute +`sorted` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Values`: memref of any type values or tensor of any type values -1. `Indices`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`K` | memref of any type values or tensor of any type values -### onnx.Transpose (ONNXTransposeOp) -ONNX Transpose operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Values` | memref of any type values or tensor of any type values +`Indices` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Transpose` (ONNXTransposeOp) +ONNX Transpose operation "Transpose the input tensor similar to numpy.transpose. For example, when" "perm=(1, 0, 2), given an input tensor of shape (1, 2, 3), the output shape" "will be (2, 1, 3)." -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `perm` | `ArrayAttr` | 64-bit integer array attribute attribute | +`perm` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `transposed`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.Unique (ONNXUniqueOp) -ONNX Unique operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`transposed` | memref of any type values or tensor of any type values +### `onnx.Unique` (ONNXUniqueOp) + +ONNX Unique operation "Find the unique elements of a tensor. When an optional attribute 'axis' is provided, unique subtensors sliced along the 'axis' are returned. " "Otherwise the input tensor is flattened and unique values of the flattened tensor are returned. " @@ -5178,29 +5241,31 @@ ONNX Unique operation "" " output_counts = [2 1 1]" -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axis` | `IntegerAttr` | 64-bit integer attribute attribute | -| `sorted` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`sorted` | IntegerAttr | 64-bit signless integer attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values -1. `indices`: memref of any type values or tensor of any type values or none type -1. `inverse_indices`: memref of any type values or tensor of any type values or none type -1. `counts`: memref of any type values or tensor of any type values or none type +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values -### onnx.Unsqueeze (ONNXUnsqueezeOp) -ONNX Unsqueeze operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values +`indices` | memref of any type values or tensor of any type values or none type +`inverse_indices` | memref of any type values or tensor of any type values or none type +`counts` | memref of any type values or tensor of any type values or none type -#### Description: +### `onnx.Unsqueeze` (ONNXUnsqueezeOp) +ONNX Unsqueeze operation "Insert single-dimensional entries to the shape of an input tensor (`data`)." "Takes one required argument `axes` - which contains a list of dimension indices and this operator will insert a dimension of value `1` into the corresponding index of the output tensor (`expanded`)." @@ -5215,50 +5280,54 @@ ONNX Unsqueeze operation "The order of values in `axes` does not matter and can come in any order. " "" -#### Operands: - -1. `data`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `axes` | `ArrayAttr` | 64-bit integer array attribute attribute | +`axes` | ArrayAttr | 64-bit integer array attribute -#### Results: +#### Operands: -1. `expanded`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values -### onnx.Upsample (ONNXUpsampleOp) -ONNX Upsample operation +#### Results: -#### Description: +| Result | Description | +| :----: | ----------- | +`expanded` | memref of any type values or tensor of any type values +### `onnx.Upsample` (ONNXUpsampleOp) + +ONNX Upsample operation "Upsample the input tensor." "Each dimension value of the output tensor is:" " output_dimension = floor(input_dimension * scale)." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values -1. `scales`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `mode` | `StringAttr` | string attribute attribute | +`mode` | StringAttr | string attribute -#### Results: +#### Operands: -1. `Y`: memref of any type values or tensor of any type values +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values +`scales` | memref of any type values or tensor of any type values -### onnx.Where (ONNXWhereOp) -ONNX Where operation +#### Results: + +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Where` (ONNXWhereOp) +ONNX Where operation "Return elements, either from X or Y, depending on condition" " (with Numpy-style broadcasting support)." @@ -5267,22 +5336,21 @@ ONNX Where operation #### Operands: -1. `condition`: memref of any type values or tensor of any type values -1. `X`: memref of any type values or tensor of any type values -1. `Y`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`condition` | memref of any type values or tensor of any type values +`X` | memref of any type values or tensor of any type values +`Y` | memref of any type values or tensor of any type values #### Results: -1. `output`: memref of any type values or tensor of any type values - -### onnx.Xor (ONNXXorOp) -ONNX Xor operation +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values -#### Description: +### `onnx.Xor` (ONNXXorOp) +ONNX Xor operation "Returns the tensor resulted from performing the `xor` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." @@ -5291,13 +5359,14 @@ ONNX Xor operation #### Operands: -1. `A`: memref of any type values or tensor of any type values -1. `B`: memref of any type values or tensor of any type values - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`A` | memref of any type values or tensor of any type values +`B` | memref of any type values or tensor of any type values #### Results: -1. `C`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values diff --git a/src/Builder/FrontendDialectHelper.hpp b/src/Builder/FrontendDialectHelper.hpp index 0fcc1958a1..e920cd61b9 100644 --- a/src/Builder/FrontendDialectHelper.hpp +++ b/src/Builder/FrontendDialectHelper.hpp @@ -15,7 +15,7 @@ #include #include "mlir/Analysis/Verifier.h" -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/Builders.h" #include "mlir/IR/Function.h" diff --git a/src/Conversion/ONNXToKrnl/ConvertONNXToKrnl.cpp b/src/Conversion/ONNXToKrnl/ConvertONNXToKrnl.cpp index fe6f5d4fff..0549587890 100644 --- a/src/Conversion/ONNXToKrnl/ConvertONNXToKrnl.cpp +++ b/src/Conversion/ONNXToKrnl/ConvertONNXToKrnl.cpp @@ -21,7 +21,7 @@ class ONNXEntryPointLowering : public OpRewritePattern { public: using OpRewritePattern::OpRewritePattern; - PatternMatchResult matchAndRewrite(ONNXEntryPointOp op, + LogicalResult matchAndRewrite(ONNXEntryPointOp op, PatternRewriter &rewriter) const override { rewriter.replaceOpWithNewOp( op, @@ -30,7 +30,7 @@ class ONNXEntryPointLowering : public OpRewritePattern { op.getAttrOfType(ONNXEntryPointOp::getNumInputsAttrName()), op.getAttrOfType( ONNXEntryPointOp::getNumOutputsAttrName())); - return matchSuccess(); + return success(); } }; @@ -56,7 +56,7 @@ void FrontendToKrnlLoweringPass::runOnModule() { // We define the specific operations, or dialects, that are legal targets for // this lowering. target - .addLegalDialect(); + .addLegalDialect(); // TODO: enable this once more ops are supported. // We also define the ONNX dialect as Illegal so that the conversion will fail diff --git a/src/Conversion/ONNXToKrnl/Math/Elementwise.cpp b/src/Conversion/ONNXToKrnl/Math/Elementwise.cpp index 0a8916b08f..75990f0daa 100644 --- a/src/Conversion/ONNXToKrnl/Math/Elementwise.cpp +++ b/src/Conversion/ONNXToKrnl/Math/Elementwise.cpp @@ -495,7 +495,7 @@ template struct ONNXElementwiseUnaryOpLowering : public ConversionPattern { ONNXElementwiseUnaryOpLowering(MLIRContext *ctx) : ConversionPattern(ElementwiseUnaryOp::getOperationName(), 1, ctx) {} - PatternMatchResult + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { // TODO: Check that the types are valid. @@ -553,7 +553,7 @@ struct ONNXElementwiseUnaryOpLowering : public ConversionPattern { rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; @@ -563,7 +563,7 @@ template struct ONNXElementwiseVariadicOpLowering : public ConversionPattern { ONNXElementwiseVariadicOpLowering(MLIRContext *ctx) : ConversionPattern(ElementwiseVariadicOp::getOperationName(), 1, ctx) {} - PatternMatchResult + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { // TODO: Check that the types are valid. @@ -633,7 +633,7 @@ struct ONNXElementwiseVariadicOpLowering : public ConversionPattern { rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Math/Gemm.cpp b/src/Conversion/ONNXToKrnl/Math/Gemm.cpp index c95a4686a5..e17e9552c9 100644 --- a/src/Conversion/ONNXToKrnl/Math/Gemm.cpp +++ b/src/Conversion/ONNXToKrnl/Math/Gemm.cpp @@ -17,7 +17,7 @@ struct ONNXGemmOpLowering : public ConversionPattern { ONNXGemmOpLowering(MLIRContext *ctx) : ConversionPattern(GemmOp::getOperationName(), 1, ctx) {} - PatternMatchResult + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { auto loc = op->getLoc(); @@ -210,7 +210,7 @@ struct ONNXGemmOpLowering : public ConversionPattern { rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Math/MatMul.cpp b/src/Conversion/ONNXToKrnl/Math/MatMul.cpp index c9a86afbc1..39428d7468 100644 --- a/src/Conversion/ONNXToKrnl/Math/MatMul.cpp +++ b/src/Conversion/ONNXToKrnl/Math/MatMul.cpp @@ -16,7 +16,7 @@ struct ONNXMatMulOpLowering : public ConversionPattern { ONNXMatMulOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXMatMulOp::getOperationName(), 1, ctx) {} - PatternMatchResult + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { auto loc = op->getLoc(); @@ -330,7 +330,7 @@ struct ONNXMatMulOpLowering : public ConversionPattern { rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Math/Reduction.cpp b/src/Conversion/ONNXToKrnl/Math/Reduction.cpp index 533e7feaf0..f1b0bb5e64 100644 --- a/src/Conversion/ONNXToKrnl/Math/Reduction.cpp +++ b/src/Conversion/ONNXToKrnl/Math/Reduction.cpp @@ -107,7 +107,7 @@ struct ONNXReductionOpLowering : public ConversionPattern { ONNXReductionOpLowering(MLIRContext *ctx) : ConversionPattern(ONNXReductionOp::getOperationName(), 1, ctx) {} - PatternMatchResult + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { /* @@ -271,7 +271,7 @@ struct ONNXReductionOpLowering : public ConversionPattern { rewriter.create(loc, accumulated, alloc, outLoopIVs); rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Math/Softmax.cpp b/src/Conversion/ONNXToKrnl/Math/Softmax.cpp index 8fc6d0afa7..ebdf0d1bf5 100644 --- a/src/Conversion/ONNXToKrnl/Math/Softmax.cpp +++ b/src/Conversion/ONNXToKrnl/Math/Softmax.cpp @@ -15,7 +15,7 @@ using namespace mlir; struct ONNXSoftmaxOpLowering : public ConversionPattern { ONNXSoftmaxOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXSoftmaxOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { // softmax(x) = let max_x = max(x) in // let exp_x = exp(x - max_x) in @@ -196,7 +196,7 @@ struct ONNXSoftmaxOpLowering : public ConversionPattern { rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/NN/Conv.cpp b/src/Conversion/ONNXToKrnl/NN/Conv.cpp index 17f6c68437..070527dd5c 100644 --- a/src/Conversion/ONNXToKrnl/NN/Conv.cpp +++ b/src/Conversion/ONNXToKrnl/NN/Conv.cpp @@ -16,7 +16,7 @@ struct ONNXConvOpLowering : public ConversionPattern { ONNXConvOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXConvOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { auto loc = op->getLoc(); ONNXConvOpOperandAdaptor operandAdaptor(operands); @@ -250,7 +250,7 @@ struct ONNXConvOpLowering : public ConversionPattern { } rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/NN/Normalization.cpp b/src/Conversion/ONNXToKrnl/NN/Normalization.cpp index f5297de9e1..6d5a0f8445 100644 --- a/src/Conversion/ONNXToKrnl/NN/Normalization.cpp +++ b/src/Conversion/ONNXToKrnl/NN/Normalization.cpp @@ -17,7 +17,7 @@ struct ONNXBatchNormalizationTestModeOpLowering : public ConversionPattern { : ConversionPattern( mlir::ONNXBatchNormalizationTestModeOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { // batchnorm{epsilon}(x, scale, bias, mean, variance) = // scale * (x - mean) / sqrt(variance + epsilon) + bias @@ -133,7 +133,7 @@ struct ONNXBatchNormalizationTestModeOpLowering : public ConversionPattern { rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/NN/Pooling.cpp b/src/Conversion/ONNXToKrnl/NN/Pooling.cpp index 82c13973a4..c3b090fc0f 100644 --- a/src/Conversion/ONNXToKrnl/NN/Pooling.cpp +++ b/src/Conversion/ONNXToKrnl/NN/Pooling.cpp @@ -36,7 +36,7 @@ struct ONNXMaxPoolSingleOutOpLowering : public ConversionPattern { : ConversionPattern( mlir::ONNXMaxPoolSingleOutOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { ONNXMaxPoolSingleOutOpOperandAdaptor operandAdaptor(operands); auto loc = op->getLoc(); @@ -315,7 +315,7 @@ struct ONNXMaxPoolSingleOutOpLowering : public ConversionPattern { } rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/ONNXToKrnlCommon.hpp b/src/Conversion/ONNXToKrnl/ONNXToKrnlCommon.hpp index a6d121520d..7403cc4dbc 100644 --- a/src/Conversion/ONNXToKrnl/ONNXToKrnlCommon.hpp +++ b/src/Conversion/ONNXToKrnl/ONNXToKrnlCommon.hpp @@ -13,8 +13,8 @@ #include -#include "mlir/Dialect/AffineOps/AffineOps.h" -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/Affine/IR/AffineOps.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/ADT/ArrayRef.h" diff --git a/src/Conversion/ONNXToKrnl/Tensor/Constant.cpp b/src/Conversion/ONNXToKrnl/Tensor/Constant.cpp index 17f9bc4708..72893547c3 100644 --- a/src/Conversion/ONNXToKrnl/Tensor/Constant.cpp +++ b/src/Conversion/ONNXToKrnl/Tensor/Constant.cpp @@ -47,7 +47,7 @@ struct ONNXConstantOpLowering : public ConversionPattern { ONNXConstantOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXConstantOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { auto loc = op->getLoc(); auto constantOp = llvm::dyn_cast(op); @@ -90,7 +90,7 @@ struct ONNXConstantOpLowering : public ConversionPattern { // Replace this operation with the generated alloc. rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Tensor/Identity.cpp b/src/Conversion/ONNXToKrnl/Tensor/Identity.cpp index c4612b0327..e31a68f7f3 100644 --- a/src/Conversion/ONNXToKrnl/Tensor/Identity.cpp +++ b/src/Conversion/ONNXToKrnl/Tensor/Identity.cpp @@ -16,11 +16,11 @@ struct ONNXIdentityOpLowering : public ConversionPattern { ONNXIdentityOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXIdentityOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { ONNXIdentityOpOperandAdaptor operandAdaptor(operands); rewriter.replaceOp(op, operandAdaptor.input()); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Tensor/PadConstantValuePad.cpp b/src/Conversion/ONNXToKrnl/Tensor/PadConstantValuePad.cpp index 417a6f950b..0638171003 100644 --- a/src/Conversion/ONNXToKrnl/Tensor/PadConstantValuePad.cpp +++ b/src/Conversion/ONNXToKrnl/Tensor/PadConstantValuePad.cpp @@ -17,7 +17,7 @@ struct ONNXPadConstantValuePadOpLowering : public ConversionPattern { : ConversionPattern( mlir::ONNXPadConstantValuePadOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { auto tensorType = (*op->result_type_begin()); ONNXPadConstantValuePadOpOperandAdaptor operandAdaptor(operands); @@ -98,7 +98,7 @@ struct ONNXPadConstantValuePadOpLowering : public ConversionPattern { // Replace the original op with the generated code. rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Tensor/Reshape.cpp b/src/Conversion/ONNXToKrnl/Tensor/Reshape.cpp index 7eb73ac173..4b2c01b7fb 100644 --- a/src/Conversion/ONNXToKrnl/Tensor/Reshape.cpp +++ b/src/Conversion/ONNXToKrnl/Tensor/Reshape.cpp @@ -16,7 +16,7 @@ struct ONNXReshapeOpLowering : public ConversionPattern { ONNXReshapeOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXReshapeOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { ONNXReshapeOpOperandAdaptor operandAdaptor(operands); auto loc = op->getLoc(); @@ -139,7 +139,7 @@ struct ONNXReshapeOpLowering : public ConversionPattern { rewriter.create(loc, alloc, data, tensorSize); rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Tensor/Transpose.cpp b/src/Conversion/ONNXToKrnl/Tensor/Transpose.cpp index 11cf9d8079..53da2198d2 100644 --- a/src/Conversion/ONNXToKrnl/Tensor/Transpose.cpp +++ b/src/Conversion/ONNXToKrnl/Tensor/Transpose.cpp @@ -16,7 +16,7 @@ struct ONNXTransposeOpLowering : public ConversionPattern { ONNXTransposeOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXTransposeOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { ONNXTransposeOpOperandAdaptor operandAdaptor(operands); auto loc = op->getLoc(); @@ -93,7 +93,7 @@ struct ONNXTransposeOpLowering : public ConversionPattern { rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Conversion/ONNXToKrnl/Tensor/Unsqueeze.cpp b/src/Conversion/ONNXToKrnl/Tensor/Unsqueeze.cpp index 502b8317f5..d9215e2678 100644 --- a/src/Conversion/ONNXToKrnl/Tensor/Unsqueeze.cpp +++ b/src/Conversion/ONNXToKrnl/Tensor/Unsqueeze.cpp @@ -16,7 +16,7 @@ struct ONNXUnsqueezeOpLowering : public ConversionPattern { ONNXUnsqueezeOpLowering(MLIRContext *ctx) : ConversionPattern(mlir::ONNXUnsqueezeOp::getOperationName(), 1, ctx) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const final { ONNXUnsqueezeOpOperandAdaptor operandAdaptor(operands); auto loc = op->getLoc(); @@ -77,7 +77,7 @@ struct ONNXUnsqueezeOpLowering : public ConversionPattern { } rewriter.create(loc, alloc, data, tensorSize); rewriter.replaceOp(op, alloc); - return matchSuccess(); + return success(); } }; diff --git a/src/Dialect/Krnl/KrnlHelper.cpp b/src/Dialect/Krnl/KrnlHelper.cpp index 3e46815f22..fa3818af39 100644 --- a/src/Dialect/Krnl/KrnlHelper.cpp +++ b/src/Dialect/Krnl/KrnlHelper.cpp @@ -8,8 +8,8 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/AffineOps/AffineOps.h" -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/Affine/IR/AffineOps.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/AffineExpr.h" #include "KrnlOps.hpp" diff --git a/src/Dialect/Krnl/KrnlOps.cpp b/src/Dialect/Krnl/KrnlOps.cpp index 05fc8d62ac..ec240b3a33 100644 --- a/src/Dialect/Krnl/KrnlOps.cpp +++ b/src/Dialect/Krnl/KrnlOps.cpp @@ -11,8 +11,8 @@ #include #include -#include "mlir/Dialect/AffineOps/AffineOps.h" -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/Affine/IR/AffineOps.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Block.h" #include "mlir/IR/Builders.h" #include "mlir/IR/Function.h" diff --git a/src/Dialect/ONNX/ONNXOps.hpp b/src/Dialect/ONNX/ONNXOps.hpp index 6b8b413589..ab19f26af8 100644 --- a/src/Dialect/ONNX/ONNXOps.hpp +++ b/src/Dialect/ONNX/ONNXOps.hpp @@ -13,7 +13,7 @@ #include #include -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Builders.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/OpDefinition.h" diff --git a/src/Dialect/ONNX/ONNXOps.td.inc b/src/Dialect/ONNX/ONNXOps.td.inc index e92e2e40af..93351f9bb7 100644 --- a/src/Dialect/ONNX/ONNXOps.td.inc +++ b/src/Dialect/ONNX/ONNXOps.td.inc @@ -4,6 +4,7 @@ // This file is automatically generated via script. // Details can be found in doc/readonnxdefs.md . //******************************************************** +include "mlir/Interfaces/SideEffects.td" def ONNXAbsOp:ONNX_Op<"Abs", [NoSideEffect, DeclareOpInterfaceMethods]> { diff --git a/src/MainUtils.cpp b/src/MainUtils.cpp index 57bf4f0edc..6ef8d622c8 100644 --- a/src/MainUtils.cpp +++ b/src/MainUtils.cpp @@ -45,7 +45,7 @@ void EmitLLVMBitCode(const mlir::OwningModuleRef &module) { } void registerDialects() { - mlir::registerDialect(); + mlir::registerDialect(); mlir::registerDialect(); mlir::registerDialect(); mlir::registerDialect(); diff --git a/src/Tool/ONNXMLIROpt/ONNXMLIROpt.cpp b/src/Tool/ONNXMLIROpt/ONNXMLIROpt.cpp index 2ec2563f7e..5c46194214 100644 --- a/src/Tool/ONNXMLIROpt/ONNXMLIROpt.cpp +++ b/src/Tool/ONNXMLIROpt/ONNXMLIROpt.cpp @@ -48,8 +48,13 @@ static llvm::cl::opt verify_passes( llvm::cl::desc("Run the verifier after each transformation pass"), llvm::cl::init(true)); +static llvm::cl::opt allowUnregisteredDialects( + "allow-unregistered-dialect", + llvm::cl::desc("Allow operation with no registered dialects"), + llvm::cl::init(false)); + int main(int argc, char **argv) { - mlir::registerDialect(); + mlir::registerDialect(); mlir::registerDialect(); mlir::registerDialect(); mlir::registerDialect(); @@ -74,5 +79,5 @@ int main(int argc, char **argv) { return failed(mlir::MlirOptMain(output->os(), std::move(file), passPipeline, split_input_file, verify_diagnostics, - verify_passes)); + verify_passes, allowUnregisteredDialects)); } diff --git a/src/Transform/LowerKrnl.cpp b/src/Transform/LowerKrnl.cpp index ec6a51b14f..7f24bf48fb 100644 --- a/src/Transform/LowerKrnl.cpp +++ b/src/Transform/LowerKrnl.cpp @@ -8,8 +8,8 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/AffineOps/AffineOps.h" -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/Affine/IR/AffineOps.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" @@ -27,7 +27,7 @@ namespace { struct KrnlIterateOpLowering : public OpRewritePattern { using OpRewritePattern::OpRewritePattern; - PatternMatchResult matchAndRewrite(KrnlIterateOp iterateOp, + LogicalResult matchAndRewrite(KrnlIterateOp iterateOp, PatternRewriter &rewriter) const override { auto boundMapAttrs = iterateOp.getAttrOfType(KrnlIterateOp::getBoundsAttrName()) @@ -81,7 +81,7 @@ struct KrnlIterateOpLowering : public OpRewritePattern { innermostForOp.region().end()); rewriter.eraseOp(iterateOp); - return matchSuccess(); + return success(); } }; @@ -93,10 +93,10 @@ class KrnlTerminatorLowering : public OpRewritePattern { public: using OpRewritePattern::OpRewritePattern; - PatternMatchResult matchAndRewrite(KrnlTerminatorOp op, + LogicalResult matchAndRewrite(KrnlTerminatorOp op, PatternRewriter &rewriter) const override { rewriter.replaceOpWithNewOp(op); - return matchSuccess(); + return success(); } }; @@ -108,10 +108,10 @@ class KrnlDefineLoopsLowering : public OpRewritePattern { public: using OpRewritePattern::OpRewritePattern; - PatternMatchResult matchAndRewrite(KrnlDefineLoopsOp op, + LogicalResult matchAndRewrite(KrnlDefineLoopsOp op, PatternRewriter &rewriter) const override { rewriter.eraseOp(op); - return matchSuccess(); + return success(); } }; @@ -123,10 +123,10 @@ class KrnlOptimizeLoopsLowering : public OpRewritePattern { public: using OpRewritePattern::OpRewritePattern; - PatternMatchResult matchAndRewrite(KrnlOptimizeLoopsOp op, + LogicalResult matchAndRewrite(KrnlOptimizeLoopsOp op, PatternRewriter &rewriter) const override { rewriter.eraseOp(op); - return matchSuccess(); + return success(); } }; @@ -149,7 +149,7 @@ void KrnlToAffineLoweringPass::runOnFunction() { ConversionTarget target(getContext()); - target.addLegalDialect(); + target.addLegalDialect(); // We expect IR to be free of Krnl Dialect Ops. target.addIllegalDialect(); target.addLegalOp(); diff --git a/src/Transform/LowerToLLVM.cpp b/src/Transform/LowerToLLVM.cpp index 9abe5393fe..2740ace665 100644 --- a/src/Transform/LowerToLLVM.cpp +++ b/src/Transform/LowerToLLVM.cpp @@ -12,10 +12,10 @@ #include "mlir/Conversion/LoopToStandard/ConvertLoopToStandard.h" #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h" #include "mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h" -#include "mlir/Dialect/AffineOps/AffineOps.h" +#include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/LoopOps/LoopOps.h" -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/ADT/Sequence.h" @@ -69,8 +69,8 @@ class KrnlMemcpyOpLowering : public ConversionPattern { explicit KrnlMemcpyOpLowering(MLIRContext *context) : ConversionPattern(KrnlMemcpyOp::getOperationName(), 1, context) {} - PatternMatchResult matchAndRewrite(Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) const override { + LogicalResult matchAndRewrite(Operation *op, ArrayRef operands, + ConversionPatternRewriter &rewriter) const override { auto *context = op->getContext(); KrnlMemcpyOpOperandAdaptor operandAdaptor(operands); auto loc = op->getLoc(); @@ -118,7 +118,7 @@ class KrnlMemcpyOpLowering : public ConversionPattern { int64Size, isVolatile})); rewriter.eraseOp(op); - return matchSuccess(); + return success(); } private: @@ -186,7 +186,7 @@ class KrnlEntryPointOpLowering : public OpRewritePattern { } }; - PatternMatchResult matchAndRewrite( + LogicalResult matchAndRewrite( KrnlEntryPointOp op, PatternRewriter &rewriter) const override { auto *llvmDialect = @@ -301,7 +301,7 @@ class KrnlEntryPointOpLowering : public OpRewritePattern { // Return wrapped output. rewriter.create( loc, SmallVector({wrappedOutput})); - return matchSuccess(); + return success(); } private: diff --git a/src/Transform/ONNX/AttributePromotion.cpp b/src/Transform/ONNX/AttributePromotion.cpp index b0c82b7795..ccc7f27f1f 100644 --- a/src/Transform/ONNX/AttributePromotion.cpp +++ b/src/Transform/ONNX/AttributePromotion.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/StandardOps/Ops.h" +#include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/IR/Builders.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" diff --git a/utils/install-mlir.sh b/utils/install-mlir.sh old mode 100644 new mode 100755 index 833d983358..12ad8c6a0c --- a/utils/install-mlir.sh +++ b/utils/install-mlir.sh @@ -1,6 +1,6 @@ git clone https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX MLIR. -cd llvm-project && git checkout 076475713c236081a3247a53e9dbab9043c3eac2 && cd .. +cd llvm-project && git checkout 07e462526d0cbae40b320e1a4307ce11e197fb0a && cd .. mkdir llvm-project/build cd llvm-project/build cmake -G Ninja ../llvm \ diff --git a/utils/install-onnx-mlir.sh b/utils/install-onnx-mlir.sh old mode 100644 new mode 100755