Lite算子支持

Linux Ascend 端侧 推理应用 初级 中级 高级

本文列举MindSpore Lite支持的算子。

操作名
 
CPU
FP16
CPU
FP32
CPU
Int8
CPU
UInt8
GPU
FP16
GPU
FP32
NPU
 
支持的TensorFlow
Lite算子
支持的Caffe
Lite算子
支持的Onnx
Lite算子
支持的TensorFlow
算子
Abs Supported Supported Supported Supported Supported Supported Supported Abs Abs Abs
Add Supported Supported Supported Supported Supported Supported Supported Add Add, Int8Add Add, AddV2
AddGrad Supported
AddN Supported AddN
Assert Supported Assert
Argmax Supported Supported Supported Supported Supported Supported Argmax ArgMax ArgMax Argmax
Argmin Supported Supported Supported Supported Supported Supported Argmin ArgMin
AvgPool Supported Supported Supported Supported Supported Supported Supported MeanPooling Pooling AveragePool, GlobalAveragePool, Int8AveragePool AvgPool
AvgPoolGrad Supported
BatchNorm Supported Supported Supported Supported Supported Supported BatchNorm BatchNormalization
BatchNormGrad Supported
BatchToSpace Supported Supported Supported Supported Supported BatchToSpace, BatchToSpaceND BatchToSpace, BatchToSpaceND
BiasAdd Supported Supported Supported Supported Supported Supported BiasAdd BiasAdd
BiasAddGrad Supported
Broadcast Supported BroadcastTo Expand
Cast Supported Supported Supported Supported Supported Supported Supported Cast, QUANTIZE, DEQUANTIZE Cast Cast
Ceil Supported Supported Supported Supported Supported Supported Supported Ceil Ceil Ceil
Concat Supported Supported Supported Supported Supported Supported Supported Concat Concat Concat ConcatV2
ConstantOfShape Supported ConstantOfShape
Conv2d Supported Supported Supported Supported Supported Supported Supported Conv2D Convolution Conv, Int8Conv, ConvRelu, Int8ConvRelu Conv2D
Conv2dGrad Supported
Conv2dTranspose Supported Supported Supported Supported Supported Supported Supported DeConv2D Deconvolution ConvTranspose Conv2DBackpropInput
Conv2dTransposeGrad Supported
Cos Supported Supported Supported Supported Supported Supported Supported Cos Cos Cos
Crop Supported Supported Supported Supported Crop
CropAndResize Supported CropAndResize
CustomExtractFeatures Supported ExtractFeatures
CustomNormalize Supported Normalize
CustomPredict Supported Predict
DeDepthwiseConv2D Supported Supported Supported Deconvolution
DepthToSpace Supported Supported Supported Supported Supported DepthToSpace DepthToSpace
DepthwiseConv2dNative Supported Supported Supported Supported Supported Supported Supported DepthwiseConv2D Convolution DepthwiseConv2dNative
DetectionPostProcess Supported Supported Supported Custom
Div Supported Supported Supported Supported Supported Supported Supported Div, RealDiv Div Div, RealDiv
DivGrad Supported
Eltwise Supported Supported Supported Supported Supported Supported Supported Eltwise Sum, Max[3]
Elu Supported Elu Elu, NonMaxSuppression NonMaxSuppressionV3
EluGrad Supported
Equal Supported Supported Supported Supported Supported Supported Supported Equal Equal Equal
Exp Supported Supported Supported Exp Exp Exp Exp
ExpandDims Supported Supported Supported Supported ExpandDims ExpandDims
Fill Supported Fill Fill
Flatten Supported Supported Flatten
Floor Supported Supported Supported Supported Supported Supported Supported flOOR Floor Floor
FloorDiv Supported Supported Supported Supported Supported FloorDiv FloorDiv
FloorMod Supported Supported Supported Supported Supported FloorMod FloorMod
FullConnection Supported Supported Supported Supported Supported Supported Supported FullyConnected InnerProduct
FusedBatchNorm Supported Supported Supported Supported Supported FusedBatchNorm FusedBatchNorm, FusedBatchNormV3
GatherNd Supported Supported Supported Supported Supported GatherND GatherNd
Gather Supported Supported Supported Supported Supported Supported Supported Gather Gather GatherV2
Greater Supported Supported Supported Supported Supported Supported Supported Greater Greater Greater
GreaterEqual Supported Supported Supported Supported Supported Supported Supported GreaterEqual GreaterEqual
GRU Supported Supported
HardTanh Supported Supported
HashtableLookup Supported HashtableLookup
HSigmoid Supported Supported
Hswish Supported Supported Supported Supported Supported Supported Supported HardSwish
HswishGrad Supported
InstanceNorm Supported Supported InstanceNorm
InvertPermutation Supported InvertPermutation
L2Norm Supported Supported L2_NORMALIZATION
LayerNorm Supported Supported
LeakyReLU Supported Supported Supported Supported Supported Supported Supported LeakyRelu LeakyRelu LeakyRelu
LeakyReLUGrad Supported
Less Supported Supported Supported Supported Supported Supported Supported Less Less Less
LessEqual Supported Supported Supported Supported Supported Supported Supported LessEqual LessEqual
LRN Supported LocalResponseNorm Lrn, LRN
Log Supported Supported Supported Supported Supported Supported Supported Log Log Log
LogGrad Supported Supported
LogicalAnd Supported Supported Supported Supported Supported LogicalAnd And LogicalAnd
LogicalNot Supported Supported Supported Supported Supported Supported Supported LogicalNot Not LogicalNot
LogicalOr Supported Supported Supported Supported Supported LogicalOr Or LogicalOr
LshProjection Supported LshProjection
LSTM Supported Supported LSTM
MatMul Supported Supported Supported Supported Supported Supported Supported MatMul MatMul, BatchMatMul
MatMulGrad Supported
Maximum Supported Supported Supported Supported Supported Maximum Maximum
MaximumGrad Supported
MaxPool Supported Supported Supported Supported Supported Supported Supported MaxPooling Pooling MaxPool, GlobalMaxPool MaxPool
MaxPoolGrad Supported
Merge Supported Supported Merge
Minimum Supported Supported Supported Supported Supported Minimum Min Minimum
MinimumGrad Supported
Mul Supported Supported Supported Supported Supported Supported Supported Mul Mul Mul
MulGrad Supported
Neg Supported Supported Supported Supported Supported Neg Neg
NegGrad Supported
NotEqual Supported Supported Supported Supported Supported Supported Supported NotEqual NotEqual
OneHot Supported Supported Supported OneHot OneHot OneHot
Pad Supported Supported Supported Supported Supported Supported Supported Pad, MirrorPad Pad MirrorPad, Pad
Pow Supported Supported Supported Supported Supported Pow Power Pow[2] Pow
PowGrad Supported
PReLU Supported Supported Supported PRELU PReLU PRelu
RandomStandardNormal Supported RandomStandardNormal
RandomUniform Supported RandomUniform
Range Supported Range Range, RaggedRange
Rank Supported Rank Rank
Reciprocal Supported Supported Supported Supported
ReduceAll Supported All
ReduceASum Supported Supported Supported Reduction
ReduceMax Supported Supported Supported Supported Supported Supported ReduceMax ReduceMax Max
ReduceMean Supported Supported Supported Supported Supported Supported Mean Reduction ReduceMean Mean
ReduceMin Supported Supported Supported Supported Supported ReduceMin ReduceMin Min
ReduceProd Supported Supported Supported Supported Supported ReduceProd ReduceProd Prod
ReduceSum Supported Supported Supported Supported Supported Sum Reduction ReduceSum Sum
ReduceSumSquare Supported Supported Supported Reduction ReduceSumSquare
ReLU Supported Supported Supported Supported Supported Supported Supported Relu ReLU Relu Relu
ReLUGrad Supported Supported
ReLU6 Supported Supported Supported Supported Supported Supported Supported Relu6 ReLU6 Clip[1] Relu6
ReLU6Grad Supported Supported
Reshape Supported Supported Supported Supported Supported Supported Supported Reshape Reshape Reshape,Flatten Reshape
Resize Supported Supported Supported Supported Supported Supported ResizeBilinear, NearestNeighbor Interp ResizeBilinear, ResizeBicubic, ResizeNearestNeighbor
ResizeGrad Supported
Reverse Supported reverse ReverseV2
ReverseSequence Supported ReverseSequence ReverseSequence
Round Supported Supported Supported Supported Supported Supported Supported Round Round Round
Rsqrt Supported Supported Supported Supported Supported Supported Supported Rsqrt Rsqrt
Select Supported Select
Selu Supported Selu
Scale Supported Supported Supported Supported Supported Supported Supported Scale
ScatterNd Supported ScatterNd
Shape Supported Supported Supported Supported Supported Supported Supported Shape Shape Shape
Sigmoid Supported Supported Supported Supported Supported Supported Supported Logistic Sigmoid Sigmoid Sigmoid
SigmoidGrad Supported Supported
Sin Supported Supported Supported Supported Supported Supported Supported Sin Sin Sin
Size Supported Size
Slice Supported Supported Supported Supported Supported Supported Supported Slice Slice Slice Slice
SkipGram Supported SKipGram
Softmax Supported Supported Supported Supported Supported Supported Supported Softmax Softmax Softmax Softmax
SoftmaxGrad Supported
SpaceToBatch Supported Supported Supported Supported Supported SpaceToBatch
SpaceToBatchND Supported Supported Supported Supported Supported SpaceToBatchND SpaceToBatchND
SpaceToDepth Supported Supported Supported SpaceToDepth SpaceToDepth
SparseToDense Supported Supported Supported SpareToDense
Split Supported Supported Supported Supported Supported Split, SplitV Split Split, SplitV
Sqrt Supported Supported Supported Supported Supported Supported Supported Sqrt Sqrt Sqrt
Square Supported Supported Supported Supported Supported Supported Supported Square Square
SquaredDifference Supported Supported Supported Supported Supported SquaredDifference SquaredDifference
Squeeze Supported Supported Supported Supported Supported Supported Squeeze Squeeze Squeeze
StridedSlice Supported Supported Supported Supported Supported Supported Supported StridedSlice StridedSlice
Stack Supported Supported Supported Supported Stack Pack
Sub Supported Supported Supported Supported Supported Supported Supported Sub Sub Sub
SubGrad Supported
Swish Supported Supported
Switch Supported Supported Switch
Tanh Supported Supported Supported Supported Supported Tanh TanH Tanh, Sign Tanh
TanhGrad Supported
TensorListFromTensor Supported Supported TensorListFromTensor
TensorListGetItem Supported Supported TensorListGetItem
TensorListReserve Supported Supported TensorListReserve
TensorListSetItem Supported Supported TensorListSetItem
TensorListStack Supported Supported TensorListStack
Tile Supported Supported Tile Tile Tile Tile
TopK Supported Supported Supported TopKV2 TopK TopKV2
Transpose Supported Supported Supported Supported Supported Supported Transpose Permute Transpose Transpose
Unique Supported Unique
Unsqueeze Supported Supported Supported Supported Supported Unsqueeze
Unstack Supported Unstack
Where Supported Where Where
ZerosLike Supported ZerosLike ZerosLike
转换工具支持的其他算子[4] Loop, Dropout, If Dropout, Enter, Exit, If, IsFinite, LinSpace, LoopCond, NextIteration, StatelessIf, StatelessWhile, While

[1] Clip:仅支持将clip(0, 6)转换为Relu6。

[2] Pow:仅支持指数为单个常数。

[3] Sum与Max:仅支持输入个数为2。

[4] 转换工具支持,但不需要具体实现的算子,一般这类算子在转化工具中被优化而消失,如被融合掉或者使用其他算子代替。