15. 附录06:已支持的算子

15.1. 本章节主要提供目前TPU-MLIR支持的算子列表

表 15.1 A

Onnx

Pytorch

Caffe

TOP

Abs

aten::abs

AbsVal

top.Abs

Acos

aten::acos

ArgMax

top.AdaptiveAvgPool

Add

aten::adaptive_avg_pool1d

top.Add

And

aten::adaptive_avg_pool2d

top.AddConst

ArgMax

aten::add

top.Arange

ArgMin

aten::addmm

top.Arccos

Atan

aten::arange

top.Arctanh

Atanh

aten::atan

top.Arg

AveragePool

aten::atanh

top.Attention

aten::avg_pool1d

top.AvgPool

aten::avg_pool2d

aten::avg_pool3d

表 15.2 B

Onnx

Pytorch

Caffe

TOP

BatchNormalization

aten::baddbmm

BatchNorm

top.BatchNorm

aten::batch_norm

BN

top.BatchNormBwd

aten::bmm

top.BatchNormTrain

表 15.3 C

Onnx

Pytorch

Caffe

TOP

Cast

aten::cat

Concat

top.Cast

Ceil

aten::ceil

ContinuationIndicator

top.Ceil

Clip

aten::channel_shuffle

Convolution

top.Clip

Concat

aten::chunk

ConvolutionDepthwise

top.Compare

Constant

aten::clamp

Crop

top.CompareConst

ConstantOfShape

aten::constant_pad_nd

top.Concat

Conv

aten::contiguous

top.ConstantFill

ConvTranspose

aten::_convolution

top.Conv

Cos

aten::_convolution_mode

top.ConvBwd_Weight

CumSum

aten::copy

top.Copy

aten::cos

top.Cos

aten::cosh

top.Cosh

top.Csc

top.CumSum

top.Custom

表 15.4 D

Onnx

Pytorch

Caffe

TOP

DepthToSpace

aten::detach

Deconvolution

top.Deconv

DequantizeLinear

aten::div

DetectionOutput

top.DeformConv2D

Div

aten::dot

Dropout

top.DepackRaw

Dropout

aten::dropout

DummyData

top.Depth2Space

top.DequantizeLinear

top.DetectionOutput

top.Div

表 15.5 E

Onnx

Pytorch

Caffe

TOP

Einsum

aten::elu

Eltwise

top.Einsum

Elu

aten::embedding

Embed

top.Elu

Equal

aten::empty

top.EmbDenseBwd

Erf

aten::eq

top.Erf

Exp

aten::erf

top.Exp

Expand

aten::exp

top.Expand

aten::expand

aten::expand_as

表 15.6 F

Onnx

Pytorch

Caffe

TOP

Flatten

aten::flatten

Flatten

top.Flatten

Floor

aten::flip

FrcnDetection

top.Floor

aten::floor

top.FrcnDetection

aten::floor_divide

表 15.7 G

Onnx

Pytorch

Caffe

TOP

Gather

aten::gather

top.GELU

GatherElements

aten::ge

top.GRU

GatherND

aten::gelu

top.Gather

GELU

aten::grid_sampler

top.GatherElements

Gemm

aten::group_norm

top.GatherND

GlobalAveragePool

aten::gru

top.GridSampler

GlobalMaxPool

aten::gt

top.GroupNorm

Greater

GreaterOrEqual

GridSample

GroupNormalization

GRU

表 15.8 H

Onnx

Pytorch

Caffe

TOP

HardSigmoid

aten::hardsigmoid

top.HardSigmoid

HardSwish

aten::hardswish

top.HardSwish

aten::hardtanh

表 15.9 I

Onnx

Pytorch

Caffe

TOP

Identity

aten::index

ImageData

top.If

If

aten::index_put_

InnerProduct

top.IndexPut

InstanceNormalization

aten::index_put

Input

top.Input

aten::index_select

Interp

top.InstanceNorm

aten::instance_norm

top.Interp

表 15.10 L

Onnx

Pytorch

Caffe

TOP

LayerNormalization

aten::layer_norm

LRN

top.LRN

LeakyRelu

aten::le

LSTM

top.LSTM

Less

aten::leaky_relu

Lstm

top.LayerNorm

LessOrEqual

aten::linear

top.LayerNormBwd

Log

aten::log

top.LayerNormTrain

LogSoftmax

aten::log2

top.LeakyRelu

Loop

aten::log_sigmoid

top.List

LRN

aten::log_softmax

top.Log

LSTM

aten::lstm

top.LogB

aten::lt

top.Loop

表 15.11 M

Onnx

Pytorch

Caffe

TOP

MatMul

aten::masked_fill

MatMul

top.MaskedFill

Max

aten::matmul

Mish

top.MatMul

MaxPool

aten::max

top.MatchTemplate

Min

aten::max_pool1d

top.Max

Mul

aten::max_pool2d

top.MaxConst

aten::max_pool3d

top.MaxPool

aten::mean

top.MaxPoolWithMask

aten::meshgrid

top.MaxUnpool

aten::min

top.MeshGrid

aten::mish

top.Min

aten::mm

top.MinConst

aten::mul

top.Mish

aten::mv

top.Mul

top.MulConst

表 15.12 N

Onnx

Pytorch

Caffe

TOP

Neg

aten::ne

Normalize

top.Nms

NonMaxSuppression

aten::neg

top.NonZero

NonZero

aten::new_full

top.None

Not

aten::new_ones

top.Normalize

aten::new_zeros

aten::nonzero

表 15.13 O

Onnx

Pytorch

Caffe

TOP

OneHot

aten::ones

aten::ones_like

表 15.14 P

Onnx

Pytorch

Caffe

TOP

Pad

aten::pad

Padding

top.PRelu

PixelNormalization

aten::permute

Permute

top.Pack

Pow

aten::pixel_shuffle

Pooling

top.Pad

PRelu

aten::pixel_unshuffle

Power

top.Permute

aten::pow

PReLU

top.PixelNorm

aten::prelu

PriorBox

top.PoolMask

Proposal

top.Pow

top.Pow2

top.Preprocess

top.PriorBox

top.Proposal

表 15.15 Q

Onnx

Pytorch

Caffe

TOP

QuantizeLinear

top.QuantizeLinear

表 15.16 R

Onnx

Pytorch

Caffe

TOP

Range

aten::reflection_pad1d

ReLU

top.RMSNorm

Reciprocal

aten::reflection_pad2d

ReLU6

top.ROIPooling

ReduceL1

aten::relu

Reorg

top.Range

ReduceL2

aten::remainder

Reshape

top.Reciprocal

ReduceMax

aten::repeat

RetinaFaceDetection

top.Reduce

ReduceMean

aten::replication_pad1d

Reverse

top.Relu

ReduceMin

aten::replication_pad2d

ROIPooling

top.Remainder

ReduceProd

aten::reshape

top.Repeate

ReduceSum

aten::roll

top.Reshape

Relu

aten::rsqrt

top.RetinaFaceDetection

Reshape

aten::rsub

top.Reverse

Resize

top.RoiAlign

RoiAlign

top.Round

Round

top.Rsqrt

表 15.17 S

Onnx

Pytorch

Caffe

TOP

ScatterElements

aten::scatter

Scale

top.Scale

ScatterND

aten::select

ShuffleChannel

top.ScaleLut

Shape

aten::sigmoid

Sigmoid

top.ScatterElements

Sigmoid

aten::sign

Silence

top.ScatterND

Sign

aten::silu

Slice

top.Shape

Sin

aten::sin

Softmax

top.ShuffleChannel

Slice

aten::sinh

Split

top.SiLU

Softmax

aten::size

top.Sigmoid

Softplus

aten::slice

top.Sign

Split

aten::softmax

top.Sin

Sqrt

aten::softplus

top.Sinh

Squeeze

aten::sort

top.Size

Sub

aten::split

top.Slice

Sum

aten::split_with_sizes

top.SliceAxis

aten::sqrt

top.Softmax

aten::squeeze

top.SoftmaxBwd

aten::stack

top.Softplus

aten::sub

top.Softsign

aten::sum

top.Split

top.Sqrt

top.Squeeze

top.StridedSlice

top.Sub

top.SubConst

top.SwapChannel

top.SwapDimInner

表 15.18 T

Onnx

Pytorch

Caffe

TOP

Tanh

aten::t

TanH

top.Tan

Tile

aten::tan

Tile

top.Tanh

TopK

aten::tanh

top.Tile

Transpose

aten::tile

top.TopK

Trilu

aten::to

top.Transpose

aten::topk

top.Trilu

aten::transpose

top.Tuple

aten::type_as

表 15.19 U

Onnx

Pytorch

Caffe

TOP

Unsqueeze

aten::unbind

Upsample

top.UnTuple

Upsample

aten::unsqueeze

top.Unpack

aten::upsample_bilinear2d

top.Unsqueeze

aten::upsample_linear1d

top.Upsample

aten::upsample_nearest1d

aten::upsample_nearest2d

aten::upsample_nearest3d

表 15.20 V

Onnx

Pytorch

Caffe

TOP

aten::view

top.Variance

top.View

表 15.21 W

Onnx

Pytorch

Caffe

TOP

Where

aten::where

top.Weight

top.WeightReorder

top.Where

表 15.22 Y

Onnx

Pytorch

Caffe

TOP

YoloDetection

top.Yield

top.YoloDetection

表 15.23 Z

Onnx

Pytorch

Caffe

TOP

aten::zeros

aten::zeros_like