算子动态shape支持情况

查看源文件

以下列表列举了PYNATIVE模式下支持动态shape功能的算子。其中部分算子可能会存在数据类型支持不全的问题,如遇到此类问题,可以通过主动插入Cast算子解决。

列表以外的算子对动态shape功能支持尚不完善,可能会执行失败。另外,图模式下,动态shape功能支持也不完善,可能会执行失败。

如遇到动态shape算子执行失败的问题,建议尽量避免在网络中引入动态shape。例如:可以通过调整算子输入,构造出全静态shape网络,或将动态shape限制在网络局部范围内。

API名称

Ascend

GPU

CPU

mindspore.Abs

✔️

✔️

✔️

mindspore.Acosh

✔️

✔️

✔️

mindspore.Adam

✔️

✔️

✔️

mindspore.AdaptiveAvgPool2D

✔️

✔️

✔️

mindspore.AdaptiveAvgPool3D

✔️

✔️

✔️

mindspore.Add

✔️

✔️

✔️

mindspore.Addcmul

✔️

✔️

✔️

mindspore.AddN

✔️

✔️

✔️

mindspore.Angle

✔️

✔️

✔️

mindspore.ArgMaxWithValue

✔️

✔️

✔️

mindspore.ArgMinWithValue

✔️

✔️

✔️

mindspore.Asin

✔️

✔️

✔️

mindspore.Asinh

✔️

✔️

✔️

mindspore.Assign

✔️

✔️

✔️

mindspore.AssignAdd

✔️

✔️

✔️

mindspore.Atan

✔️

✔️

✔️

mindspore.Atan2

✔️

✔️

✔️

mindspore.Atanh

✔️

✔️

✔️

mindspore.AvgPool

✔️

✔️

✔️

mindspore.AvgPool3D

✔️

✔️

✔️

mindspore.BatchNorm

✔️

✔️

✔️

mindspore.BCEWithLogitsLoss

✔️

✔️

✔️

mindspore.Bernoulli

✔️

✔️

mindspore.BesselI0

✔️

✔️

mindspore.BesselI0e

✔️

✔️

✔️

mindspore.BesselI1

✔️

✔️

mindspore.BesselI1e

✔️

✔️

✔️

mindspore.BesselJ0

✔️

✔️

mindspore.BesselJ1

✔️

✔️

mindspore.BiasAdd

✔️

✔️

️❌

mindspore.BinaryCrossEntropy

✔️

✔️

✔️

mindspore.BitwiseAnd

✔️

✔️

✔️

mindspore.BitwiseOr

✔️

✔️

✔️

mindspore.BitwiseXor

✔️

✔️

✔️

mindspore.BroadcastTo

✔️

✔️

✔️

mindspore.Cast

✔️

✔️

✔️

mindspore.Ceil

✔️

✔️

✔️

mindspore.Col2Im

✔️

✔️

✔️

mindspore.Complex

✔️

✔️

✔️

mindspore.Concat

✔️

✔️

✔️

mindspore.Conj

✔️

✔️

mindspore.Conv2D

✔️

✔️

✔️

mindspore.Conv2DTranspose

✔️

✔️

✔️

mindspore.Conv3D

✔️

✔️

✔️

mindspore.Conv3DTranspose

✔️

✔️

✔️

mindspore.Cos

✔️

✔️

✔️

mindspore.Cosh

✔️

✔️

✔️

mindspore.Cross

✔️

✔️

mindspore.CTCLossV2

✔️

✔️

✔️

mindspore.Cummax

✔️

✔️

mindspore.Cummin

✔️

✔️

✔️

mindspore.CumSum

✔️

✔️

️❌

mindspore.Diag

✔️

✔️

✔️

mindspore.Digamma

✔️

✔️

mindspore.Div

✔️

✔️

✔️

mindspore.Dropout

✔️

✔️

✔️

mindspore.Dropout2D

✔️

✔️

✔️

mindspore.Dropout3D

✔️

✔️

✔️

mindspore.DynamicGRUV2

✔️

mindspore.Einsum

✔️

mindspore.Elu

✔️

✔️

✔️

mindspore.Equal

✔️

✔️

✔️

mindspore.Erf

✔️

✔️

✔️

mindspore.Erfc

✔️

✔️

✔️

mindspore.Exp

✔️

✔️

✔️

mindspore.ExpandDims

✔️

✔️

✔️

mindspore.Expm1

✔️

✔️

✔️

mindspore.Eye

✔️

✔️

✔️

mindspore.FFTWithSize

✔️

✔️

✔️

mindspore.Fill

✔️

✔️

✔️

mindspore.FillV2

✔️

✔️

✔️

mindspore.Flatten

✔️

✔️

✔️

mindspore.Floor

✔️

✔️

✔️

mindspore.FloorDiv

✔️

✔️

✔️

mindspore.FloorMod

✔️

✔️

✔️

mindspore.Gather

✔️

✔️

✔️

mindspore.GatherD

✔️

✔️

✔️

mindspore.GatherNd

✔️

✔️

✔️

mindspore.Gcd

✔️

✔️

✔️

mindspore.Geqrf

✔️

✔️

✔️

mindspore.Ger

✔️

✔️

✔️

mindspore.Greater

✔️

✔️

✔️

mindspore.GreaterEqual

✔️

✔️

✔️

mindspore.GridSampler2D

✔️

✔️

✔️

mindspore.GridSampler3D

✔️

✔️

✔️

mindspore.Heaviside

✔️

✔️

✔️

mindspore.HSwish

✔️

✔️

✔️

mindspore.Hypot

✔️

✔️

✔️

mindspore.Identity

✔️

✔️

✔️

mindspore.Igammac

✔️

✔️

✔️

mindspore.Imag

✔️

✔️

✔️

mindspore.Invert

✔️

✔️

✔️

mindspore.IsFinite

✔️

✔️

✔️

mindspore.IsInf

✔️

✔️

✔️

mindspore.IsNan

✔️

✔️

✔️

mindspore.KLDivLoss

✔️

✔️

✔️

mindspore.LayerNorm

✔️

✔️

✔️

mindspore.Lcm

✔️

✔️

✔️

mindspore.LeftShift

✔️

✔️

✔️

mindspore.Lerp

✔️

✔️

✔️

mindspore.Less

✔️

✔️

✔️

mindspore.LessEqual

✔️

✔️

✔️

mindspore.LinSpace

✔️

✔️

✔️

mindspore.Log

✔️

✔️

✔️

mindspore.Log1p

✔️

✔️

✔️

mindspore.LogicalAnd

✔️

✔️

✔️

mindspore.LogicalNot

✔️

✔️

✔️

mindspore.LogicalOr

✔️

✔️

✔️

mindspore.LogicalXor

✔️

✔️

mindspore.Logit

✔️

✔️

✔️

mindspore.LogSoftmax

✔️

✔️

✔️

mindspore.LpNorm

✔️

✔️

✔️

mindspore.LRN

✔️

✔️

✔️

mindspore.MaskedFill

✔️

✔️

✔️

mindspore.MaskedSelect

✔️

✔️

✔️

mindspore.MatrixInverse

✔️

✔️

mindspore.MatrixSolve

✔️

✔️

mindspore.Maximum

✔️

✔️

✔️

mindspore.MaxPool

✔️

✔️

✔️

mindspore.MaxPool3D

✔️

✔️

✔️

mindspore.MaxUnpool2D

✔️

✔️

mindspore.Median

✔️

✔️

mindspore.Meshgrid

✔️

✔️

✔️

mindspore.Minimum

✔️

✔️

✔️

mindspore.MirrorPad

✔️

✔️

mindspore.Mish

✔️

✔️

mindspore.Mod

✔️

✔️

✔️

mindspore.Mul

✔️

✔️

✔️

mindspore.Multinomial

✔️

✔️

✔️

mindspore.Mvlgamma

✔️

✔️

✔️

mindspore.NanToNum

✔️

✔️

mindspore.Neg

✔️

✔️

✔️

mindspore.NextAfter

✔️

✔️

✔️

mindspore.NLLLoss

✔️

✔️

✔️

mindspore.nonzero

✔️

✔️

✔️

mindspore.NotEqual

✔️

✔️

✔️

mindspore.OneHot

✔️

✔️

✔️

mindspore.OnesLike

✔️

✔️

✔️

mindspore.Pad

✔️

✔️

✔️

mindspore.Polar

✔️

✔️

mindspore.Polygamma

✔️

✔️

mindspore.Pow

✔️

✔️

✔️

mindspore.PReLU

✔️

✔️

✔️

mindspore.RandpermV2

✔️

mindspore.Range

✔️

✔️

mindspore.Real

✔️

✔️

mindspore.RealDiv

✔️

✔️

✔️

mindspore.Reciprocal

✔️

✔️

✔️

mindspore.ReduceAll

✔️

✔️

✔️

mindspore.ReduceAny

✔️

✔️

✔️

mindspore.ReduceMax

✔️

✔️

✔️

mindspore.ReduceMean

✔️

✔️

✔️

mindspore.ReduceMin

✔️

✔️

✔️

mindspore.ReduceProd

✔️

✔️

✔️

mindspore.ReduceSum

✔️

✔️

✔️

mindspore.Reshape

✔️

✔️

✔️

mindspore.ResizeBicubic

✔️

✔️

✔️

mindspore.ResizeBilinearV2

✔️

✔️

️❌

mindspore.ReverseSequence

✔️

✔️

✔️

mindspore.ReverseV2

✔️

✔️

✔️

mindspore.RightShift

✔️

✔️

✔️

mindspore.Rint

✔️

✔️

✔️

mindspore.Round

✔️

✔️

✔️

mindspore.Rsqrt

✔️

✔️

✔️

mindspore.ScatterNd

✔️

✔️

✔️

mindspore.ScatterNdAdd

✔️

✔️

✔️

mindspore.ScatterNdMax

✔️

✔️

mindspore.ScatterNdMin

✔️

✔️

✔️

mindspore.ScatterNdMul

✔️

✔️

mindspore.ScatterNdSub

✔️

✔️

✔️

mindspore.ScatterNdUpdate

✔️

✔️

✔️

mindspore.ScatterSub

✔️

✔️

✔️

mindspore.ScatterUpdate

✔️

✔️

✔️

mindspore.Select

✔️

✔️

✔️

mindspore.Sigmoid

✔️

✔️

✔️

mindspore.Sign

✔️

✔️

✔️

mindspore.Sin

✔️

✔️

✔️

mindspore.Sinc

✔️

✔️

✔️

mindspore.Sinh

✔️

✔️

✔️

mindspore.Slice

✔️

✔️

✔️

mindspore.SmoothL1Loss

✔️

✔️

✔️

mindspore.Softmax

✔️

✔️

✔️

mindspore.SoftmaxCrossEntropyWithLogits

✔️

✔️

✔️

mindspore.Softplus

✔️

✔️

✔️

mindspore.SoftShrink

✔️

✔️

✔️

mindspore.Sort

✔️

✔️

mindspore.Split

✔️

✔️

️❌

mindspore.Sqrt

✔️

✔️

✔️

mindspore.Square

✔️

✔️

✔️

mindspore.Squeeze

✔️

✔️

✔️

mindspore.Stack

✔️

✔️

✔️

mindspore.StandardNormal

✔️

✔️

✔️

mindspore.StridedSlice

✔️

✔️

✔️

mindspore.Sub

✔️

✔️

✔️

mindspore.Svd

✔️

✔️

mindspore.Tan

✔️

✔️

✔️

mindspore.Tanh

✔️

✔️

✔️

mindspore.TensorScatterUpdate

✔️

✔️

✔️

mindspore.Tile

✔️

✔️

✔️

mindspore.TopK

✔️

✔️

✔️

mindspore.Trace

✔️

✔️

✔️

mindspore.Transpose

✔️

✔️

✔️

mindspore.Tril

✔️

✔️

✔️

mindspore.triu

✔️

✔️

✔️

mindspore.Trunc

✔️

✔️

✔️

mindspore.TruncateDiv

✔️

✔️

️❌

mindspore.UniformInt

✔️

✔️

mindspore.UniformReal

✔️

✔️

mindspore.Unique

✔️

✔️

✔️

mindspore.UnsortedSegmentSum

✔️

✔️

✔️

mindspore.Xlogy

✔️

✔️

✔️

mindspore.ZerosLike

✔️

✔️

✔️