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 | 3747 +++++++++-------- 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, 2003 insertions(+), 1912 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 956bc08..701bd51 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 15ed11e..aede48f 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 eb32de5..e0e8a45 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 6170f9e..9d11120 100644 --- a/doc/Dialects/onnx.md +++ b/doc/Dialects/onnx.md @@ -1,97 +1,85 @@ -# 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 (ONNXAcosOp) ONNX Acos operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Acosh` (ONNXAcoshOp) -### onnx.Acosh (ONNXAcoshOp) ONNX Acosh operation -#### Description: - - "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 (ONNXAddOp) ONNX Add operation -#### Description: - - "Performs element-wise binary addition (with Numpy-style broadcasting support)." "" "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: - +| 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 (ONNXAndOp) ONNX And operation -#### Description: - - "Returns the tensor resulted from performing the `and` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." "" @@ -99,150 +87,149 @@ 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 +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values + +### `onnx.ArgMax` (ONNXArgMaxOp) -### onnx.ArgMax (ONNXArgMaxOp) ONNX ArgMax operation -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ArgMin` (ONNXArgMinOp) -### onnx.ArgMin (ONNXArgMinOp) ONNX ArgMin operation -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.Asin` (ONNXAsinOp) -### onnx.Asin (ONNXAsinOp) ONNX Asin operation -#### Description: - - "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 (ONNXAsinhOp) ONNX Asinh operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Atan` (ONNXAtanOp) -### onnx.Atan (ONNXAtanOp) ONNX Atan operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Atanh` (ONNXAtanhOp) -### onnx.Atanh (ONNXAtanhOp) ONNX Atanh operation -#### Description: - - "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 (ONNXAveragePoolOp) ONNX AveragePool operation -#### Description: - - "AveragePool consumes an input tensor X and applies average pooling across" " the tensor according to kernel sizes, stride sizes, and pad lengths." " average pooling consisting of computing the average on all values of a" @@ -273,31 +260,33 @@ 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 + +#### 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.BatchNormalization` (ONNXBatchNormalizationOp) -### onnx.BatchNormalization (ONNXBatchNormalizationOp) ONNX BatchNormalization operation -#### Description: - - "Carries out batch normalization as described in the paper" "https://arxiv.org/abs/1502.03167. Depending on the mode it is being run," "there are multiple cases for the number of outputs, which we list below:" @@ -309,35 +298,37 @@ 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 + +#### Operands: + +| 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 #### Results: -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 +| 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 + +### `onnx.BatchNormalizationTestMode` (ONNXBatchNormalizationTestModeOp) -### onnx.BatchNormalizationTestMode (ONNXBatchNormalizationTestModeOp) ONNX BatchNormalization operation in test mode -#### Description: - - "Carries out batch normalization as described in the paper" "https://arxiv.org/abs/1502.03167. Depending on the mode it is being run," "there are multiple cases for the number of outputs, which we list below:" @@ -349,31 +340,33 @@ 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 + +#### Operands: + +| 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 #### Results: -1. `o_Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`o_Y` | memref of any type values or tensor of any type values + +### `onnx.BitShift` (ONNXBitShiftOp) -### onnx.BitShift (ONNXBitShiftOp) ONNX BitShift operation -#### Description: - - "Bitwise shift operator performs element-wise operation. For each input element, if the" " attribute \"direction\" is \"RIGHT\", this operator moves its binary representation toward" " the right side so that the input value is effectively decreased. If the attribute \"direction\"" @@ -387,27 +380,29 @@ 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 + +#### Operands: + +| 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 +| Result | Description | +| :----: | ----------- | +`Z` | memref of any type values or tensor of any type values + +### `onnx.Cast` (ONNXCastOp) -### onnx.Cast (ONNXCastOp) ONNX Cast operation -#### Description: - - "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" "the converted type. The 'to' argument must be one of the data types specified" @@ -428,250 +423,259 @@ 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 + +#### Operands: + +| 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.Ceil` (ONNXCeilOp) -### onnx.Ceil (ONNXCeilOp) ONNX Ceil operation -#### Description: - - "Ceil takes one input data (Tensor) and produces one output data" "(Tensor) where the ceil is, y = ceil(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.Clip` (ONNXClipOp) -### onnx.Clip (ONNXClipOp) ONNX Clip operation -#### Description: - - "Clip operator limits the given input within an interval. The interval is" "specified by the inputs 'min' and 'max'. They default to" "numeric_limits::lowest() and numeric_limits::max(), respectively." #### 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 (ONNXCompressOp) ONNX Compress operation -#### Description: - - "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 + +#### Operands: + +| 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 #### 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.ConcatFromSequence` (ONNXConcatFromSequenceOp) -### onnx.ConcatFromSequence (ONNXConcatFromSequenceOp) ONNX ConcatFromSequence operation -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`input_sequence` | memref of any type values or tensor of any type values #### Results: -1. `concat_result`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`concat_result` | memref of any type values or tensor of any type values + +### `onnx.Concat` (ONNXConcatOp) -### onnx.Concat (ONNXConcatOp) ONNX Concat operation -#### Description: - - "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." -#### Operands: - -1. `inputs`: 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`inputs` | memref of any type values or tensor of any type values #### Results: -1. `concat_result`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`concat_result` | memref of any type values or tensor of any type values + +### `onnx.ConstantOfShape` (ONNXConstantOfShapeOp) -### onnx.ConstantOfShape (ONNXConstantOfShapeOp) ONNX ConstantOfShape operation -#### Description: - - "Generate a tensor with given value and shape." -#### Operands: - -1. `input`: memref of any type values or tensor of any type values - #### Attributes: | Attribute | MLIR Type | Description | | :-------: | :-------: | ----------- | -| `value` | `Attribute` | any attribute attribute | +`value` | Attribute | any attribute + +#### Operands: + +| 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.Constant` (ONNXConstantOp) -### onnx.Constant (ONNXConstantOp) ONNX Constant operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.ConvInteger` (ONNXConvIntegerOp) -### onnx.ConvInteger (ONNXConvIntegerOp) ONNX ConvInteger operation -#### Description: - - "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 + +#### Operands: + +| 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 #### 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.Conv` (ONNXConvOp) -### onnx.Conv (ONNXConvOp) ONNX Conv operation -#### Description: - - "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 + +#### Operands: + +| 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 #### 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.ConvTranspose` (ONNXConvTransposeOp) -### onnx.ConvTranspose (ONNXConvTransposeOp) ONNX ConvTranspose operation -#### Description: - - "The convolution transpose operator consumes an input tensor and a filter," "and computes the output." "" @@ -687,73 +691,73 @@ 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 + +#### Operands: + +| 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 #### 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.Cos` (ONNXCosOp) -### onnx.Cos (ONNXCosOp) ONNX Cos operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Cosh` (ONNXCoshOp) -### onnx.Cosh (ONNXCoshOp) ONNX Cosh operation -#### Description: - - "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 (ONNXCumSumOp) ONNX CumSum operation -#### Description: - - "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." "Through an `exclusive` attribute, this behavior can change to exclude the first element." @@ -775,28 +779,30 @@ 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 + +#### Operands: + +| 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 #### 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.DepthToSpace` (ONNXDepthToSpaceOp) -### onnx.DepthToSpace (ONNXDepthToSpaceOp) ONNX DepthToSpace operation -#### Description: - - "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" "the input tensor where values from the depth dimension are moved in spatial blocks to the height" @@ -825,27 +831,29 @@ 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 + +#### Operands: + +| 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.DequantizeLinear` (ONNXDequantizeLinearOp) -### onnx.DequantizeLinear (ONNXDequantizeLinearOp) ONNX DequantizeLinear operation -#### Description: - - "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." "'x_zero_point' and 'x' must have same type. 'x' and 'y' must have same shape. In the case of dequantizing int32," @@ -853,23 +861,22 @@ 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 +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values + +### `onnx.Det` (ONNXDetOp) -### onnx.Det (ONNXDetOp) ONNX Det operation -#### Description: - - "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," "and the inner-most 2 dimensions form square matrices." @@ -878,43 +885,41 @@ 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 +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.Div` (ONNXDivOp) -### onnx.Div (ONNXDivOp) ONNX Div operation -#### Description: - - "Performs element-wise binary division (with Numpy-style broadcasting support)." "" "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: - +| 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 (ONNXDropoutOp) ONNX Dropout operation -#### Description: - - "Dropout takes one input floating tensor and produces two tensor outputs," "output (floating tensor) and mask (`Tensor`). Depending on whether it is" "in test mode or not, the output Y will either be a random dropout, or a simple" @@ -922,27 +927,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | 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 -1. `mask`: memref of any type values or tensor of any type values or none type +| 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 (ONNXDynamicQuantizeLinearOp) ONNX DynamicQuantizeLinear operation -#### Description: - - "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." "Scale is calculated as:" @@ -968,65 +975,55 @@ 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 +| 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 + +### `onnx.Elu` (ONNXEluOp) -### onnx.Elu (ONNXEluOp) ONNX Elu operation -#### Description: - - "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: - -#### Attributes: - +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.EntryPoint` (ONNXEntryPointOp) + +Indicate ONNX entry point + +The "onnx.EntryPoint" function indicates the main entry point of ONNX model. + +### `onnx.Equal` (ONNXEqualOp) -### onnx.Equal (ONNXEqualOp) ONNX Equal operation -#### Description: - - "Returns the tensor resulted from performing the `equal` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." "" @@ -1034,60 +1031,57 @@ 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 (ONNXErfOp) ONNX Erf operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Exp` (ONNXExpOp) -### onnx.Exp (ONNXExpOp) ONNX Exp operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Expand` (ONNXExpandOp) -### onnx.Expand (ONNXExpandOp) ONNX Expand operation -#### Description: - - "Broadcast the input tensor following the given shape and the broadcast rule." "The broadcast rule is similar to numpy.array(input) * numpy.ones(shape):" "Dimensions are right alignment;" @@ -1099,22 +1093,21 @@ 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 (ONNXEyeLikeOp) ONNX EyeLike operation -#### Description: - - "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" "same as the input tensor. The data type can be specified by the 'dtype' argument. If" @@ -1123,72 +1116,75 @@ 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 + +#### Operands: + +| 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.Flatten` (ONNXFlattenOp) -### onnx.Flatten (ONNXFlattenOp) ONNX Flatten operation -#### Description: - - "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 + +#### Operands: + +| 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.Floor` (ONNXFloorOp) -### onnx.Floor (ONNXFloorOp) ONNX Floor operation -#### Description: - - "Floor takes one input data (Tensor) and produces one output data" "(Tensor) where the floor is, y = floor(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.GRU` (ONNXGRUOp) -### onnx.GRU (ONNXGRUOp) ONNX GRU operation -#### Description: - - "Computes an one-layer GRU. This operator is usually supported via some custom" "implementation such as CuDNN." "" @@ -1263,38 +1259,40 @@ 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 + +#### Operands: + +| 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 #### Results: -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 +| 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.GatherElements` (ONNXGatherElementsOp) -### onnx.GatherElements (ONNXGatherElementsOp) ONNX GatherElements operation -#### Description: - - "GatherElements takes two inputs `data` and `indices` of the same rank r >= 1" "and an optional attribute `axis` that identifies an axis of `data`" "(by default, the outer-most axis, that is axis 0). It is an indexing operation" @@ -1351,27 +1349,29 @@ 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 + +#### Operands: + +| 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.GatherND` (ONNXGatherNDOp) -### onnx.GatherND (ONNXGatherNDOp) ONNX GatherND operation -#### Description: - - "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,22 +1440,21 @@ 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Gather` (ONNXGatherOp) -### onnx.Gather (ONNXGatherOp) ONNX Gather operation -#### Description: - - "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" "them in an output tensor of rank q + (r - 1)." @@ -1514,27 +1513,29 @@ 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 + +#### Operands: + +| 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Gemm` (ONNXGemmOp) -### onnx.Gemm (ONNXGemmOp) ONNX Gemm operation -#### Description: - - "General Matrix multiplication:" "https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3" "" @@ -1549,97 +1550,99 @@ 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 + +#### Operands: + +| 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 #### 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.GlobalAveragePool` (ONNXGlobalAveragePoolOp) -### onnx.GlobalAveragePool (ONNXGlobalAveragePoolOp) ONNX GlobalAveragePool operation -#### Description: - - "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" " equal to the spatial dimension of input tensor." #### 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 (ONNXGlobalLpPoolOp) ONNX GlobalLpPool operation -#### Description: - - "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 + +#### 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.GlobalMaxPool` (ONNXGlobalMaxPoolOp) -### onnx.GlobalMaxPool (ONNXGlobalMaxPoolOp) ONNX GlobalMaxPool operation -#### Description: - - "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" " equal to the spatial dimension of input tensor." #### 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 (ONNXGreaterOp) ONNX Greater operation -#### Description: - - "Returns the tensor resulted from performing the `greater` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." "" @@ -1647,47 +1650,48 @@ 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 +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values + +### `onnx.HardSigmoid` (ONNXHardSigmoidOp) -### onnx.HardSigmoid (ONNXHardSigmoidOp) ONNX HardSigmoid operation -#### Description: - - "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 + +#### 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.Hardmax` (ONNXHardmaxOp) -### onnx.Hardmax (ONNXHardmaxOp) ONNX Hardmax operation -#### Description: - - "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,68 +1707,71 @@ 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 + +#### Operands: + +| 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.Identity` (ONNXIdentityOp) -### onnx.Identity (ONNXIdentityOp) ONNX Identity operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.If` (ONNXIfOp) -### onnx.If (ONNXIfOp) ONNX If operation -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`cond` | memref of any type values or tensor of any type values #### Results: -1. `outputs`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`outputs` | memref of any type values or tensor of any type values + +### `onnx.InstanceNormalization` (ONNXInstanceNormalizationOp) -### onnx.InstanceNormalization (ONNXInstanceNormalizationOp) ONNX InstanceNormalization operation -#### Description: - - "Carries out instance normalization as described in the paper" "https://arxiv.org/abs/1607.08022." "" @@ -1772,70 +1779,73 @@ 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 | +`epsilon` | FloatAttr | 32-bit float attribute + +#### Operands: + +| 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 #### 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.IsInf` (ONNXIsInfOp) -### onnx.IsInf (ONNXIsInfOp) ONNX IsInf operation -#### Description: - - "Map infinity to true and other values to false." -#### Operands: - -1. `X`: memref of any type values or tensor of any type values - #### 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 + +#### 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.IsNaN` (ONNXIsNaNOp) -### onnx.IsNaN (ONNXIsNaNOp) ONNX IsNaN operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.LRN` (ONNXLRNOp) -### onnx.LRN (ONNXLRNOp) ONNX LRN operation -#### Description: - - "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." "The local region is defined across the channels. For an element X[n, c, d1, ..., dk] in a tensor" @@ -1847,29 +1857,31 @@ 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 (ONNXLSTMOp) ONNX LSTM operation -#### Description: - - "Computes an one-layer LSTM. This operator is usually supported via some" "custom implementation such as CuDNN." "" @@ -1952,65 +1964,69 @@ 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 + +#### Operands: + +| 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 #### Results: -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 +| 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 (ONNXLeakyReluOp) ONNX LeakyRelu operation -#### Description: - - "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 + +#### 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.Less` (ONNXLessOp) -### onnx.Less (ONNXLessOp) ONNX Less operation -#### Description: - - "Returns the tensor resulted from performing the `less` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." "" @@ -2018,41 +2034,39 @@ 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 (ONNXLogOp) ONNX Log operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.LogSoftmax` (ONNXLogSoftmaxOp) -### onnx.LogSoftmax (ONNXLogSoftmaxOp) ONNX LogSoftmax operation -#### Description: - - "The operator computes the logsoftmax (log of softmax) values for each layer in the batch" " of the given input." "" @@ -2068,26 +2082,28 @@ 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 + +#### Operands: + +| 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.Loop` (ONNXLoopOp) -### onnx.Loop (ONNXLoopOp) ONNX Loop operation -#### Description: - - "Generic Looping construct. This loop has multiple termination conditions:" "" "1) Trip count. Iteration count specified at runtime. Set by" @@ -2202,145 +2218,148 @@ 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 | +`body` | Attribute | any attribute + +#### Operands: + +| 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 #### Results: -1. `v_final_and_scan_outputs`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`v_final_and_scan_outputs` | memref of any type values or tensor of any type values + +### `onnx.LpNormalization` (ONNXLpNormalizationOp) -### onnx.LpNormalization (ONNXLpNormalizationOp) ONNX LpNormalization operation -#### Description: - - "Given a matrix, apply Lp-normalization along the provided axis." -#### 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 | -| `p` | `IntegerAttr` | 64-bit integer attribute attribute | +`axis` | IntegerAttr | 64-bit signless integer attribute +`p` | IntegerAttr | 64-bit signless integer attribute + +#### Operands: + +| 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.LpPool` (ONNXLpPoolOp) -### onnx.LpPool (ONNXLpPoolOp) ONNX LpPool operation -#### Description: - - "LpPool consumes an input tensor X and applies Lp pooling across" " the tensor according to kernel sizes, stride sizes, and pad lengths." " Lp pooling consisting of computing the Lp norm on all values of a subset" " 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 + +#### 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.MatMulInteger` (ONNXMatMulIntegerOp) -### onnx.MatMulInteger (ONNXMatMulIntegerOp) ONNX MatMulInteger operation -#### Description: - - "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 (ONNXMatMulOp) ONNX MatMul operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.Max` (ONNXMaxOp) -### onnx.Max (ONNXMaxOp) ONNX Max operation -#### Description: - - "Element-wise max of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." "This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md)." #### 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 (ONNXMaxPoolOp) ONNX MaxPool operation -#### Description: - - "MaxPool consumes an input tensor X and applies max pooling across" " the tensor according to kernel sizes, stride sizes, and pad lengths." " max pooling consisting of computing the max on all values of a" @@ -2371,88 +2390,94 @@ 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 + +#### 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 -1. `Indices`: memref of any type values or tensor of any type values or none type +| 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.MaxPoolSingleOut (ONNXMaxPoolSingleOutOp) ONNX MaxPool operation with a single output. -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`X` | memref of any type values or tensor of any type values #### Results: -1. `o_Y`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`o_Y` | memref of any type values or tensor of any type values + +### `onnx.MaxRoiPool` (ONNXMaxRoiPoolOp) -### onnx.MaxRoiPool (ONNXMaxRoiPoolOp) ONNX MaxRoiPool operation -#### Description: - - "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 + +#### Operands: + +| 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 #### 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.MaxUnpool` (ONNXMaxUnpoolOp) -### onnx.MaxUnpool (ONNXMaxUnpoolOp) ONNX MaxUnpool operation -#### Description: - - "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" " input tensor X is the tensor that needs to be unpooled, which is typically the pooled tensor (first output)" @@ -2472,95 +2497,97 @@ 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 + +#### Operands: + +| 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 #### 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.Mean` (ONNXMeanOp) -### onnx.Mean (ONNXMeanOp) ONNX Mean operation -#### Description: - - "Element-wise mean of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." "This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md)." #### 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 +| Result | Description | +| :----: | ----------- | +`mean` | memref of any type values or tensor of any type values + +### `onnx.MeanVarianceNormalization` (ONNXMeanVarianceNormalizationOp) -### onnx.MeanVarianceNormalization (ONNXMeanVarianceNormalizationOp) ONNX MeanVarianceNormalization operation -#### Description: - - "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 + +#### 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.Min` (ONNXMinOp) -### onnx.Min (ONNXMinOp) ONNX Min operation -#### Description: - - "Element-wise min of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." "This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md)." #### 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 +| Result | Description | +| :----: | ----------- | +`min` | memref of any type values or tensor of any type values + +### `onnx.Mod` (ONNXModOp) -### onnx.Mod (ONNXModOp) ONNX Mod operation -#### Description: - - "Performs element-wise binary modulus (with Numpy-style broadcasting support). " " The sign of the remainder is the same as that of the Divisor." " " @@ -2575,95 +2602,97 @@ 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 + +#### Operands: + +| 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.Mul` (ONNXMulOp) -### onnx.Mul (ONNXMulOp) ONNX Mul operation -#### Description: - - "Performs element-wise binary multiplication (with Numpy-style broadcasting support)." "" "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: - +| 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 (ONNXMultinomialOp) ONNX Multinomial operation -#### Description: - - "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 + +#### Operands: + +| 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.Neg` (ONNXNegOp) -### onnx.Neg (ONNXNegOp) ONNX Neg operation -#### Description: - - "Neg takes one input data (Tensor) and produces one output data" "(Tensor) where each element flipped sign, y = -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.NonMaxSuppression` (ONNXNonMaxSuppressionOp) -### onnx.NonMaxSuppression (ONNXNonMaxSuppressionOp) ONNX NonMaxSuppression operation -#### Description: - - "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." "Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to" @@ -2672,30 +2701,32 @@ 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 + +#### Operands: + +| 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 #### Results: -1. `selected_indices`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`selected_indices` | memref of any type values or tensor of any type values + +### `onnx.NonZero` (ONNXNonZeroOp) -### onnx.NonZero (ONNXNonZeroOp) ONNX NonZero operation -#### Description: - - "Returns the indices of the elements that are non-zero" " (in row-major order - by dimension)." " NonZero behaves similar to numpy.nonzero:" @@ -2703,40 +2734,38 @@ 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 +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.Not` (ONNXNotOp) -### onnx.Not (ONNXNotOp) ONNX Not operation -#### Description: - - "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 (ONNXOneHotOp) ONNX OneHot operation -#### Description: - - "Produces a one-hot tensor based on inputs." " The locations represented by the index values in the 'indices' input tensor will have 'on_value'" " and the other locations will have 'off_value' in the output tensor, where 'on_value' and 'off_value'" @@ -2757,28 +2786,30 @@ 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 + +#### Operands: + +| 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 #### 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.Or` (ONNXOrOp) -### onnx.Or (ONNXOrOp) ONNX Or operation -#### Description: - - "Returns the tensor resulted from performing the `or` logical operation" "elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support)." "" @@ -2786,22 +2817,21 @@ 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 +| Result | Description | +| :----: | ----------- | +`C` | memref of any type values or tensor of any type values + +### `onnx.PRelu` (ONNXPReluOp) -### onnx.PRelu (ONNXPReluOp) ONNX PRelu operation -#### Description: - - "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`," "`f(x) = x for x >= 0`., is applied to the data tensor elementwise." @@ -2809,102 +2839,107 @@ 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 +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.PadConstantPad` (ONNXPadConstantPadOp) -### onnx.PadConstantPad (ONNXPadConstantPadOp) ONNX Pad operation with constant padding value -#### Description: - - "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 + +#### Operands: + +| 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 #### 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.PadConstantValue` (ONNXPadConstantValueOp) -### onnx.PadConstantValue (ONNXPadConstantValueOp) ONNX Pad operation with constant padding value -#### Description: - - "this operation is introduced to handle situation" " in which the padding value is a constant. " The value will become an attribute." "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 + +#### Operands: + +| 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 #### 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.PadConstantValuePad` (ONNXPadConstantValuePadOp) -### onnx.PadConstantValuePad (ONNXPadConstantValuePadOp) ONNX Pad operation with constant padding value -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | 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.Pad` (ONNXPadOp) -### onnx.Pad (ONNXPadOp) ONNX Pad operation -#### Description: - - "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,28 +3022,30 @@ 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 + +#### Operands: + +| 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 #### 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.Pow` (ONNXPowOp) -### onnx.Pow (ONNXPowOp) ONNX Pow operation -#### Description: - - "Pow takes input data (Tensor) and exponent Tensor, and" "produces one output data (Tensor) where the function `f(x) = x^exponent`," "is applied to the data tensor elementwise." @@ -3016,61 +3053,62 @@ 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 +| Result | Description | +| :----: | ----------- | +`Z` | memref of any type values or tensor of any type values + +### `onnx.QLinearConv` (ONNXQLinearConvOp) -### onnx.QLinearConv (ONNXQLinearConvOp) ONNX QLinearConv operation -#### Description: - - "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," "and computes the quantized output. Each scale and zero-point pair must have same shape." "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 + +#### Operands: + +| 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 #### 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.QLinearMatMul` (ONNXQLinearMatMulOp) -### onnx.QLinearMatMul (ONNXQLinearMatMulOp) ONNX QLinearMatMul operation -#### Description: - - "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." "The quantization formula is y = saturate((x / y_scale) + y_zero_point). For (x / y_scale), it is rounding to nearest ties to even." @@ -3082,51 +3120,49 @@ 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 +| Result | Description | +| :----: | ----------- | +`y` | memref of any type values or tensor of any type values + +### `onnx.QuantizeLinear` (ONNXQuantizeLinearOp) -### onnx.QuantizeLinear (ONNXQuantizeLinearOp) ONNX QuantizeLinear operation -#### Description: - - "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." "For (x / y_scale), it's rounding to nearest ties to even. Refer to https://en.wikipedia.org/wiki/Rounding for details. 'y_zero_point' and 'y' must have same type." #### 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 (ONNXRNNOp) ONNX RNN operation -#### Description: - - "Computes an one-layer simple RNN. This operator is usually supported" "via some custom implementation such as CuDNN." "" @@ -3189,37 +3225,39 @@ 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 + +#### Operands: + +| 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 #### Results: -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 +| 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 (ONNXRandomNormalLikeOp) ONNX RandomNormalLike operation -#### Description: - - "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," "and the parameters of the normal distribution are specified by `mean` and `scale`." @@ -3228,29 +3266,31 @@ 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 + +#### Operands: + +| 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.RandomNormal` (ONNXRandomNormalOp) -### onnx.RandomNormal (ONNXRandomNormalOp) ONNX RandomNormal operation -#### Description: - - "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" "specified by `mean` and `scale`." @@ -3259,29 +3299,26 @@ 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 (ONNXRandomUniformLikeOp) ONNX RandomUniformLike operation -#### Description: - - "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," "and the parameters of the uniform distribution are specified by `low` and `high`." @@ -3290,29 +3327,31 @@ 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 + +#### Operands: + +| 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.RandomUniform` (ONNXRandomUniformOp) -### onnx.RandomUniform (ONNXRandomUniformOp) ONNX RandomUniform operation -#### Description: - - "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,29 +3359,26 @@ 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Range` (ONNXRangeOp) -### onnx.Range (ONNXRangeOp) ONNX Range operation -#### Description: - - "Generate a tensor containing a sequence of numbers that begin at `start` and extends by increments of `delta` " "up to `limit` (exclusive)." "" @@ -3371,44 +3407,42 @@ 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Reciprocal` (ONNXReciprocalOp) -### onnx.Reciprocal (ONNXReciprocalOp) ONNX Reciprocal operation -#### Description: - - "Reciprocal takes one input data (Tensor) and produces one output data" "(Tensor) where the reciprocal is, y = 1/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.ReduceL1` (ONNXReduceL1Op) -### onnx.ReduceL1 (ONNXReduceL1Op) ONNX ReduceL1 operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3416,27 +3450,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceL2` (ONNXReduceL2Op) -### onnx.ReduceL2 (ONNXReduceL2Op) ONNX ReduceL2 operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3444,27 +3480,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceLogSumExp` (ONNXReduceLogSumExpOp) -### onnx.ReduceLogSumExp (ONNXReduceLogSumExpOp) ONNX ReduceLogSumExp operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3472,27 +3510,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceLogSum` (ONNXReduceLogSumOp) -### onnx.ReduceLogSum (ONNXReduceLogSumOp) ONNX ReduceLogSum operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3500,27 +3540,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceMax` (ONNXReduceMaxOp) -### onnx.ReduceMax (ONNXReduceMaxOp) ONNX ReduceMax operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3528,27 +3570,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceMean` (ONNXReduceMeanOp) -### onnx.ReduceMean (ONNXReduceMeanOp) ONNX ReduceMean operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3556,27 +3600,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceMin` (ONNXReduceMinOp) -### onnx.ReduceMin (ONNXReduceMinOp) ONNX ReduceMin operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3584,27 +3630,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceProd` (ONNXReduceProdOp) -### onnx.ReduceProd (ONNXReduceProdOp) ONNX ReduceProd operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3612,27 +3660,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceSum` (ONNXReduceSumOp) -### onnx.ReduceSum (ONNXReduceSumOp) ONNX ReduceSum operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3640,27 +3690,29 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.ReduceSumSquare` (ONNXReduceSumSquareOp) -### onnx.ReduceSumSquare (ONNXReduceSumSquareOp) ONNX ReduceSumSquare operation -#### Description: - - "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" "the resulted tensor have the reduced dimension pruned." @@ -3668,48 +3720,49 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `reduced`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`reduced` | memref of any type values or tensor of any type values + +### `onnx.Relu` (ONNXReluOp) -### onnx.Relu (ONNXReluOp) ONNX Relu operation -#### Description: - - "Relu takes one input data (Tensor) and produces one output data" "(Tensor) where the rectified linear function, y = max(0, 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.Reshape` (ONNXReshapeOp) -### onnx.Reshape (ONNXReshapeOp) ONNX Reshape operation -#### Description: - - "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." "At most one dimension of the new shape can be -1. In this case, the value is" @@ -3719,54 +3772,55 @@ 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 +| Result | Description | +| :----: | ----------- | +`reshaped` | memref of any type values or tensor of any type values + +### `onnx.Resize` (ONNXResizeOp) -### onnx.Resize (ONNXResizeOp) ONNX Resize operation -#### Description: - - "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 + +#### Operands: + +| 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 #### 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.ReverseSequence` (ONNXReverseSequenceOp) -### onnx.ReverseSequence (ONNXReverseSequenceOp) ONNX ReverseSequence operation -#### Description: - - "Reverse batch of sequences having different lengths specified by `sequence_lens`." "" "For each slice i iterating on batch axis, the operator reverses the first sequence_lens[i] elements on time axis," @@ -3801,28 +3855,30 @@ 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 + +#### Operands: + +| 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 #### 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.RoiAlign` (ONNXRoiAlignOp) -### onnx.RoiAlign (ONNXRoiAlignOp) ONNX RoiAlign operation -#### Description: - - "Region of Interest (RoI) align operation described in the" "[Mask R-CNN paper](https://arxiv.org/abs/1703.06870)." "RoiAlign consumes an input tensor X and region of interests (rois)" @@ -3835,32 +3891,34 @@ 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 + +#### Operands: + +| 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 #### 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.Round` (ONNXRoundOp) -### onnx.Round (ONNXRoundOp) ONNX Round operation -#### Description: - - "Round takes one input Tensor and rounds the values, element-wise, meaning" "it finds the nearest integer for each value." "In case of halfs, the rule is to round them to the nearest even integer." @@ -3877,21 +3935,20 @@ 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 +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.Scan` (ONNXScanOp) -### onnx.Scan (ONNXScanOp) ONNX Scan operation -#### Description: - - "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," "functional programming constructs such as scan, fold, map, and zip and is intended to enable" @@ -4014,31 +4071,33 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`initial_state_and_scan_inputs` | memref of any type values or tensor of any type values #### Results: -1. `final_state_and_scan_outputs`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`final_state_and_scan_outputs` | memref of any type values or tensor of any type values + +### `onnx.ScatterElements` (ONNXScatterElementsOp) -### onnx.ScatterElements (ONNXScatterElementsOp) ONNX ScatterElements operation -#### Description: - - "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`" "(by default, the outer-most axis, that is axis 0). The output of the operation" @@ -4091,28 +4150,30 @@ 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 + +#### Operands: + +| 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.ScatterND` (ONNXScatterNDOp) -### onnx.ScatterND (ONNXScatterNDOp) ONNX ScatterND operation -#### Description: - - "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" "is produced by creating a copy of the input `data`, and then updating its value to values" @@ -4172,23 +4233,22 @@ 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Scatter` (ONNXScatterOp) -### onnx.Scatter (ONNXScatterOp) ONNX Scatter operation -#### Description: - - "This operator is deprecated. Please use ScatterElements, which provides the same functionality." "" "Scatter takes three inputs `data`, `updates`, and `indices` of the same" @@ -4243,117 +4303,116 @@ 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 + +#### Operands: + +| 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Selu` (ONNXSeluOp) -### onnx.Selu (ONNXSeluOp) ONNX Selu operation -#### Description: - - "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 + +#### 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.SequenceAt` (ONNXSequenceAtOp) -### onnx.SequenceAt (ONNXSequenceAtOp) ONNX SequenceAt operation -#### Description: - - "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'." "Negative value means counting positions from the back." #### 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 +| Result | Description | +| :----: | ----------- | +`tensor` | memref of any type values or tensor of any type values + +### `onnx.SequenceConstruct` (ONNXSequenceConstructOp) -### onnx.SequenceConstruct (ONNXSequenceConstructOp) ONNX SequenceConstruct operation -#### Description: - - "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 (ONNXSequenceEmptyOp) ONNX SequenceEmpty operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.SequenceErase` (ONNXSequenceEraseOp) -### onnx.SequenceErase (ONNXSequenceEraseOp) ONNX SequenceErase operation -#### Description: - - "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'." "Negative value means counting positions from the back." @@ -4361,22 +4420,21 @@ 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 (ONNXSequenceInsertOp) ONNX SequenceInsert operation -#### Description: - - "Outputs a tensor sequence that inserts 'tensor' into 'input_sequence' at 'position'." "'tensor' must have the same data type as 'input_sequence'." "Accepted range for 'position' is in `[-n, n]`, where `n` is the number of tensors in 'input_sequence'." @@ -4385,185 +4443,179 @@ 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 +| Result | Description | +| :----: | ----------- | +`output_sequence` | memref of any type values or tensor of any type values + +### `onnx.SequenceLength` (ONNXSequenceLengthOp) -### onnx.SequenceLength (ONNXSequenceLengthOp) ONNX SequenceLength operation -#### Description: - - "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 (ONNXShapeOp) ONNX Shape operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`shape` | memref of any type values or tensor of any type values + +### `onnx.Shrink` (ONNXShrinkOp) -### onnx.Shrink (ONNXShrinkOp) ONNX Shrink operation -#### Description: - - "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 + +#### Operands: + +| 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.Sigmoid` (ONNXSigmoidOp) -### onnx.Sigmoid (ONNXSigmoidOp) ONNX Sigmoid operation -#### Description: - - "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" "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.Sign` (ONNXSignOp) -### onnx.Sign (ONNXSignOp) ONNX Sign operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Sin` (ONNXSinOp) -### onnx.Sin (ONNXSinOp) ONNX Sin operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Sinh` (ONNXSinhOp) -### onnx.Sinh (ONNXSinhOp) ONNX Sinh operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Size` (ONNXSizeOp) -### onnx.Size (ONNXSizeOp) ONNX Size operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`size` | memref of any type values or tensor of any type values + +### `onnx.Slice` (ONNXSliceOp) -### onnx.Slice (ONNXSliceOp) ONNX Slice operation -#### Description: - - "Produces a slice of the input tensor along multiple axes. Similar to numpy:" "https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html" "Slices uses `starts`, `ends`, `axes` and `steps` inputs to specify the start and end" @@ -4601,25 +4653,24 @@ 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Softmax` (ONNXSoftmaxOp) -### onnx.Softmax (ONNXSoftmaxOp) ONNX Softmax operation -#### Description: - - "The operator computes the softmax (normalized exponential) values for each layer in the batch" " of the given input." "" @@ -4635,115 +4686,119 @@ 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 + +#### Operands: + +| 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.Softplus` (ONNXSoftplusOp) -### onnx.Softplus (ONNXSoftplusOp) ONNX Softplus operation -#### Description: - - "Softplus takes one input data (Tensor) and produces one output data" "(Tensor) where the softplus function, y = ln(exp(x) + 1), 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.Softsign` (ONNXSoftsignOp) -### onnx.Softsign (ONNXSoftsignOp) ONNX Softsign operation -#### Description: - - "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 (ONNXSpaceToDepthOp) ONNX SpaceToDepth operation -#### Description: - - "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 + +#### Operands: + +| 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.Split` (ONNXSplitOp) -### onnx.Split (ONNXSplitOp) ONNX Split operation -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`input` | memref of any type values or tensor of any type values #### Results: -1. `outputs`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`outputs` | memref of any type values or tensor of any type values + +### `onnx.SplitToSequence` (ONNXSplitToSequenceOp) -### onnx.SplitToSequence (ONNXSplitToSequenceOp) ONNX SplitToSequence operation -#### Description: - - "Split a tensor into a sequence of tensors, along the specified" "'axis'. Lengths of the parts can be specified using argument 'split'." "'split' must contain only positive numbers." @@ -4755,74 +4810,77 @@ 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 + +#### Operands: + +| 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 #### 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.Sqrt` (ONNXSqrtOp) -### onnx.Sqrt (ONNXSqrtOp) ONNX Sqrt operation -#### Description: - - "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" "the tensor elementwise. If x is negative, then it will return 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 +| Result | Description | +| :----: | ----------- | +`Y` | memref of any type values or tensor of any type values + +### `onnx.Squeeze` (ONNXSqueezeOp) -### onnx.Squeeze (ONNXSqueezeOp) ONNX Squeeze operation -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `squeezed`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`squeezed` | memref of any type values or tensor of any type values + +### `onnx.StringNormalizer` (ONNXStringNormalizerOp) -### onnx.StringNormalizer (ONNXStringNormalizerOp) ONNX StringNormalizer operation -#### Description: - - "StringNormalization performs string operations for basic cleaning." "This operator has only one input (denoted by X) and only one output" "(denoted by Y). This operator first examines the elements in the X," @@ -4833,110 +4891,108 @@ 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 + +#### 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.Sub` (ONNXSubOp) -### onnx.Sub (ONNXSubOp) ONNX Sub operation -#### Description: - - "Performs element-wise binary subtraction (with Numpy-style broadcasting support)." "" "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: - +| 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.Sum` (ONNXSumOp) -### onnx.Sum (ONNXSumOp) ONNX Sum operation -#### Description: - - "Element-wise sum of each of the input tensors (with Numpy-style broadcasting support)." "All inputs and outputs must have the same data type." "This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md)." #### 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 +| Result | Description | +| :----: | ----------- | +`sum` | memref of any type values or tensor of any type values + +### `onnx.Tan` (ONNXTanOp) -### onnx.Tan (ONNXTanOp) ONNX Tan operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Tanh` (ONNXTanhOp) -### onnx.Tanh (ONNXTanhOp) ONNX Tanh operation -#### Description: - - "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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.TfIdfVectorizer` (ONNXTfIdfVectorizerOp) -### onnx.TfIdfVectorizer (ONNXTfIdfVectorizerOp) ONNX TfIdfVectorizer operation -#### Description: - - "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." "For 2-D input, the output is also a 2-D tensor whose i-th row is the n-gram representation of the i-th input row." @@ -4965,80 +5021,83 @@ 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 + +#### 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.ThresholdedRelu` (ONNXThresholdedReluOp) -### onnx.ThresholdedRelu (ONNXThresholdedReluOp) ONNX ThresholdedRelu operation -#### Description: - - "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 + +#### 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.Tile` (ONNXTileOp) -### onnx.Tile (ONNXTileOp) ONNX Tile operation -#### Description: - - "Constructs a tensor by tiling a given tensor." "This is the same as function `tile` in Numpy, but no broadcast." "For example A = [[1, 2], [3, 4]], B = [1, 2], tile(A, B) = [[1, 2, 1, 2], [3, 4, 3, 4]]" #### 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.TopK` (ONNXTopKOp) -### onnx.TopK (ONNXTopKOp) ONNX TopK operation -#### Description: - - "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:" " -Value tensor of shape [a_1, a_2, ..., a_{axis-1}, k, a_{axis+1}, ... a_n]" @@ -5054,54 +5113,58 @@ 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 + +#### Operands: + +| 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 #### Results: -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 +| 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 + +### `onnx.Transpose` (ONNXTransposeOp) -### onnx.Transpose (ONNXTransposeOp) ONNX Transpose operation -#### Description: - - "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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `transposed`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`transposed` | memref of any type values or tensor of any type values + +### `onnx.Unique` (ONNXUniqueOp) -### onnx.Unique (ONNXUniqueOp) ONNX Unique operation -#### Description: - - "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,30 +5241,32 @@ 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 + +#### 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 -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 +| 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 + +### `onnx.Unsqueeze` (ONNXUnsqueezeOp) -### onnx.Unsqueeze (ONNXUnsqueezeOp) ONNX Unsqueeze operation -#### Description: - - "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,51 +5280,55 @@ 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 + +#### Operands: + +| Operand | Description | +| :-----: | ----------- | +`data` | memref of any type values or tensor of any type values #### Results: -1. `expanded`: memref of any type values or tensor of any type values +| Result | Description | +| :----: | ----------- | +`expanded` | memref of any type values or tensor of any type values + +### `onnx.Upsample` (ONNXUpsampleOp) -### onnx.Upsample (ONNXUpsampleOp) ONNX Upsample operation -#### Description: - - "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 + +#### Operands: + +| 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 #### 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.Where` (ONNXWhereOp) -### onnx.Where (ONNXWhereOp) ONNX Where operation -#### Description: - - "Return elements, either from X or Y, depending on condition" " (with Numpy-style broadcasting support)." " Where behaves like numpy.where with three parameters:" @@ -5267,23 +5336,22 @@ 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 +| Result | Description | +| :----: | ----------- | +`output` | memref of any type values or tensor of any type values + +### `onnx.Xor` (ONNXXorOp) -### onnx.Xor (ONNXXorOp) ONNX Xor operation -#### Description: - - "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 0fcc195..e920cd6 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 fe6f5d4..0549587 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 @@ public: 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 0a8916b..75990f0 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 c95a468..e17e955 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 c9a86af..39428d7 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 533e7fe..f1b0bb5 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 8fc6d0a..ebdf0d1 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 17f6c68..070527d 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 f5297de..6d5a0f8 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 82c1397..c3b090f 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 a6d1215..7403cc4 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 17f9bc4..7289354 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 c4612b0..e31a68f 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 417a6f9..0638171 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 7eb73ac..4b2c01b 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 11cf9d8..53da219 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 502b831..d9215e2 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 3e46815..fa3818a 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 05fc8d6..ec240b3 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 6b8b413..ab19f26 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 e92e2e4..93351f9 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 57bf4f0..6ef8d62 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 2ec2563..5c46194 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 ec6a51b..7f24bf4 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 9abe539..2740ace 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 @@ public: 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 @@ public: int64Size, isVolatile})); rewriter.eraseOp(op); - return matchSuccess(); + return success(); } private: @@ -186,7 +186,7 @@ public: } }; - PatternMatchResult matchAndRewrite( + LogicalResult matchAndRewrite( KrnlEntryPointOp op, PatternRewriter &rewriter) const override { auto *llvmDialect = @@ -301,7 +301,7 @@ public: // 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 b0c82b7..ccc7f27 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 833d983..12ad8c6 --- 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