functional接口动态shape支持情况

查看源文件

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

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

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

API名称

Ascend

GPU

CPU

mindspore.ops.abs

✔️

✔️

✔️

mindspore.ops.acos

✔️

✔️

✔️

mindspore.ops.acosh

✔️

✔️

✔️

mindspore.ops.add

✔️

✔️

✔️

mindspore.ops.addcdiv

✔️

✔️

✔️

mindspore.ops.addcmul

✔️

✔️

✔️

mindspore.ops.addmm

✔️

✔️

✔️

mindspore.ops.addn

✔️

✔️

✔️

mindspore.ops.all

✔️

✔️

✔️

mindspore.ops.amax

✔️

✔️

✔️

mindspore.ops.amin

✔️

✔️

✔️

mindspore.ops.angle

✔️

✔️

✔️

mindspore.ops.any

✔️

✔️

✔️

mindspore.ops.argmax

✔️

✔️

✔️

mindspore.ops.argmin

✔️

✔️

✔️

mindspore.ops.argsort

✔️

✔️

✔️

mindspore.ops.asin

✔️

✔️

✔️

mindspore.ops.asinh

✔️

✔️

✔️

mindspore.ops.assign

✔️

✔️

✔️

mindspore.ops.assign_add

✔️

✔️

✔️

mindspore.ops.atan

✔️

✔️

✔️

mindspore.ops.atan2

✔️

✔️

✔️

mindspore.ops.atanh

✔️

✔️

✔️

mindspore.ops.baddbmm

✔️

✔️

✔️

mindspore.ops.bernoulli

✔️

✔️

mindspore.ops.bessel_i0

✔️

✔️

mindspore.ops.bessel_i0e

✔️

✔️

✔️

mindspore.ops.bessel_i1

✔️

✔️

mindspore.ops.bessel_i1e

✔️

✔️

✔️

mindspore.ops.bessel_j0

✔️

✔️

mindspore.ops.bessel_j1

✔️

✔️

mindspore.ops.bias_add

✔️

✔️

mindspore.ops.bincount

✔️

✔️

✔️

mindspore.ops.bitwise_and

✔️

✔️

✔️

mindspore.ops.bitwise_left_shift

✔️

✔️

✔️

mindspore.ops.bitwise_or

✔️

✔️

✔️

mindspore.ops.bitwise_right_shift

✔️

✔️

✔️

mindspore.ops.bitwise_xor

✔️

✔️

✔️

mindspore.ops.bmm

✔️

✔️

✔️

mindspore.ops.broadcast_to

✔️

✔️

✔️

mindspore.ops.ceil

✔️

✔️

✔️

mindspore.ops.celu

✔️

✔️

✔️

mindspore.ops.chunk

✔️

✔️

mindspore.ops.clamp

✔️

✔️

✔️

mindspore.ops.clip_by_global_norm

✔️

✔️

✔️

mindspore.ops.clip_by_value

✔️

✔️

✔️

mindspore.ops.concat

✔️

✔️

✔️

mindspore.ops.conj

✔️

✔️

mindspore.ops.cos

✔️

✔️

✔️

mindspore.ops.cosh

✔️

✔️

✔️

mindspore.ops.cross

✔️

✔️

mindspore.ops.cross_entropy

✔️

✔️

✔️

mindspore.ops.cummax

✔️

✔️

mindspore.ops.cummin

✔️

✔️

✔️

mindspore.ops.cumprod

✔️

✔️

mindspore.ops.cumsum

✔️

✔️

mindspore.ops.diag

✔️

✔️

✔️

mindspore.ops.diag_embed

✔️

✔️

✔️

mindspore.ops.diagonal

✔️

✔️

✔️

mindspore.ops.dist

✔️

✔️

✔️

mindspore.ops.div

✔️

✔️

✔️

mindspore.ops.dot

✔️

✔️

✔️

mindspore.ops.dropout

✔️

✔️

✔️

mindspore.ops.dropout2d

✔️

✔️

✔️

mindspore.ops.dropout3d

✔️

✔️

✔️

mindspore.ops.einsum

✔️

mindspore.ops.elu

✔️

✔️

✔️

mindspore.ops.equal

✔️

✔️

✔️

mindspore.ops.erf

✔️

✔️

✔️

mindspore.ops.erfc

✔️

✔️

✔️

mindspore.ops.erfinv

✔️

✔️

✔️

mindspore.ops.exp

✔️

✔️

✔️

mindspore.ops.expand_dims

✔️

✔️

✔️

mindspore.ops.expm1

✔️

✔️

✔️

mindspore.ops.eye

✔️

✔️

✔️

mindspore.ops.fill

✔️

✔️

✔️

mindspore.ops.flatten

✔️

✔️

✔️

mindspore.ops.flip

✔️

✔️

✔️

mindspore.ops.floor

✔️

✔️

✔️

mindspore.ops.floor_div

✔️

✔️

✔️

mindspore.ops.floor_mod

✔️

✔️

✔️

mindspore.ops.fmod

✔️

✔️

✔️

mindspore.ops.fold

✔️

✔️

✔️

mindspore.ops.full

✔️

✔️

✔️

mindspore.ops.full_like

✔️

✔️

✔️

mindspore.ops.gather

✔️

✔️

✔️

mindspore.ops.gather_elements

✔️

✔️

✔️

mindspore.ops.gather_nd

✔️

✔️

✔️

mindspore.ops.gcd

✔️

✔️

✔️

mindspore.ops.ge

✔️

✔️

✔️

mindspore.ops.gelu

✔️

✔️

✔️

mindspore.ops.geqrf

✔️

✔️

✔️

mindspore.ops.ger

✔️

✔️

✔️

mindspore.ops.glu

✔️

✔️

✔️

mindspore.ops.greater

✔️

✔️

✔️

mindspore.ops.greater_equal

✔️

✔️

✔️

mindspore.ops.grid_sample

✔️

✔️

✔️

mindspore.ops.gt

✔️

✔️

✔️

mindspore.ops.gumbel_softmax

✔️

✔️

✔️

mindspore.ops.hardshrink

✔️

✔️

✔️

mindspore.ops.hardsigmoid

✔️

✔️

✔️

mindspore.ops.hardswish

✔️

✔️

✔️

mindspore.ops.hardtanh

✔️

✔️

✔️

mindspore.ops.heaviside

✔️

✔️

✔️

mindspore.ops.hypot

✔️

✔️

✔️

mindspore.ops.igammac

✔️

✔️

✔️

mindspore.ops.imag

✔️

✔️

✔️

mindspore.ops.index_select

✔️

✔️

✔️

mindspore.ops.interpolate

✔️

✔️

mindspore.ops.inverse

✔️

✔️

mindspore.ops.invert

✔️

✔️

✔️

mindspore.ops.isfinite

✔️

✔️

✔️

mindspore.ops.isinf

✔️

✔️

✔️

mindspore.ops.isnan

✔️

✔️

✔️

mindspore.ops.l1_loss

✔️

✔️

✔️

mindspore.ops.lcm

✔️

✔️

✔️

mindspore.ops.le

✔️

✔️

✔️

mindspore.ops.lerp

✔️

✔️

✔️

mindspore.ops.less

✔️

✔️

✔️

mindspore.ops.less_equal

✔️

✔️

✔️

mindspore.ops.linspace

✔️

✔️

✔️

mindspore.ops.log

✔️

✔️

✔️

mindspore.ops.log_softmax

✔️

✔️

✔️

mindspore.ops.log10

✔️

✔️

✔️

mindspore.ops.log1p

✔️

✔️

✔️

mindspore.ops.log2

✔️

✔️

✔️

mindspore.ops.logical_and

✔️

✔️

✔️

mindspore.ops.logical_not

✔️

✔️

✔️

mindspore.ops.logical_or

✔️

✔️

✔️

mindspore.ops.logical_xor

✔️

✔️

mindspore.ops.logit

✔️

✔️

✔️

mindspore.ops.logsumexp

✔️

✔️

✔️

mindspore.ops.lt

✔️

✔️

✔️

mindspore.ops.margin_ranking_loss

✔️

✔️

✔️

mindspore.ops.masked_fill

✔️

✔️

✔️

mindspore.ops.masked_select

✔️

✔️

✔️

mindspore.ops.matmul

✔️

✔️

✔️

mindspore.ops.matrix_solve

✔️

✔️

mindspore.ops.max

✔️

✔️

✔️

mindspore.ops.maximum

✔️

✔️

✔️

mindspore.ops.mean

✔️

✔️

✔️

mindspore.ops.median

✔️

✔️

mindspore.ops.meshgrid

✔️

✔️

✔️

mindspore.ops.min

✔️

✔️

✔️

mindspore.ops.minimum

✔️

✔️

✔️

mindspore.ops.mish

✔️

✔️

mindspore.ops.mse_loss

✔️

✔️

✔️

mindspore.ops.mul

✔️

✔️

✔️

mindspore.ops.multinomial

✔️

✔️

✔️

mindspore.ops.mv

✔️

✔️

✔️

mindspore.ops.mvlgamma

✔️

✔️

✔️

mindspore.ops.nan_to_num

✔️

✔️

mindspore.ops.narrow

✔️

✔️

✔️

mindspore.ops.ne

✔️

✔️

✔️

mindspore.ops.neg

✔️

✔️

✔️

mindspore.ops.nll_loss

✔️

✔️

✔️

mindspore.ops.nonzero

✔️

✔️

✔️

mindspore.ops.norm

✔️

✔️

mindspore.ops.normal

✔️

✔️

✔️

mindspore.ops.numel

✔️

✔️

✔️

mindspore.ops.one_hot

✔️

✔️

✔️

mindspore.ops.ones

✔️

✔️

✔️

mindspore.ops.ones_like

✔️

✔️

✔️

mindspore.ops.pad

✔️

✔️

✔️

mindspore.ops.polar

✔️

✔️

mindspore.ops.polygamma

✔️

✔️

mindspore.ops.pow

✔️

✔️

✔️

mindspore.ops.prelu

✔️

✔️

✔️

mindspore.ops.prod

✔️

✔️

✔️

mindspore.ops.rand

✔️

✔️

✔️

mindspore.ops.rand_like

✔️

✔️

✔️

mindspore.ops.randint

✔️

✔️

✔️

mindspore.ops.randn

✔️

✔️

✔️

mindspore.ops.randn_like

✔️

✔️

✔️

mindspore.ops.randperm

✔️

mindspore.ops.range

✔️

✔️

mindspore.ops.ravel

✔️

✔️

✔️

mindspore.ops.real

✔️

✔️

mindspore.ops.reciprocal

✔️

✔️

✔️

mindspore.ops.relu

✔️

✔️

✔️

mindspore.ops.relu6

✔️

✔️

✔️

mindspore.ops.remainder

✔️

✔️

✔️

mindspore.ops.repeat_interleave

✔️

✔️

✔️

mindspore.ops.reshape

✔️

✔️

✔️

mindspore.ops.reverse

✔️

✔️

✔️

mindspore.ops.reverse_sequence

✔️

✔️

✔️

mindspore.ops.roll

✔️

mindspore.ops.round

✔️

✔️

✔️

mindspore.ops.rsqrt

✔️

✔️

✔️

mindspore.ops.scatter_nd

✔️

✔️

✔️

mindspore.ops.scatter_nd_add

✔️

✔️

✔️

mindspore.ops.scatter_nd_max

✔️

✔️

mindspore.ops.scatter_nd_min

✔️

✔️

✔️

mindspore.ops.scatter_nd_mul

✔️

✔️

mindspore.ops.scatter_nd_sub

✔️

✔️

✔️

mindspore.ops.scatter_update

✔️

✔️

✔️

mindspore.ops.select

✔️

✔️

✔️

mindspore.ops.selu

✔️

✔️

✔️

mindspore.ops.sigmoid

✔️

✔️

✔️

mindspore.ops.sign

✔️

✔️

✔️

mindspore.ops.silu

✔️

✔️

✔️

mindspore.ops.sin

✔️

✔️

✔️

mindspore.ops.sinc

✔️

✔️

✔️

mindspore.ops.sinh

✔️

✔️

✔️

mindspore.ops.slice

✔️

✔️

✔️

mindspore.ops.softmax

✔️

✔️

✔️

mindspore.ops.softshrink

✔️

✔️

✔️

mindspore.ops.sort

✔️

✔️

mindspore.ops.split

✔️

✔️

mindspore.ops.sqrt

✔️

✔️

✔️

mindspore.ops.square

✔️

✔️

✔️

mindspore.ops.squeeze

✔️

✔️

✔️

mindspore.ops.stack

✔️

✔️

✔️

mindspore.ops.std

✔️

✔️

mindspore.ops.strided_slice

✔️

✔️

✔️

mindspore.ops.sub

✔️

✔️

✔️

mindspore.ops.sum

✔️

✔️

✔️

mindspore.ops.svd

✔️

✔️

mindspore.ops.tan

✔️

✔️

✔️

mindspore.ops.tanh

✔️

✔️

✔️

mindspore.ops.tile

✔️

✔️

✔️

mindspore.ops.topk

✔️

✔️

✔️

mindspore.ops.trace

✔️

✔️

✔️

mindspore.ops.transpose

✔️

✔️

✔️

mindspore.ops.tril

✔️

✔️

✔️

mindspore.ops.triu

✔️

✔️

✔️

mindspore.ops.trunc

✔️

✔️

✔️

mindspore.ops.unfold

✔️

✔️

✔️

mindspore.ops.uniform

✔️

✔️

mindspore.ops.unique

✔️

✔️

✔️

mindspore.ops.unsorted_segment_sum

✔️

✔️

✔️

mindspore.ops.unsqueeze

✔️

✔️

✔️

mindspore.ops.unstack

✔️

✔️

✔️

mindspore.ops.where

✔️

✔️

✔️

mindspore.ops.xlogy

✔️

✔️

✔️

mindspore.ops.zeros

✔️

✔️

✔️

mindspore.ops.zeros_like

✔️

✔️

✔️

mindspore.ops.zeta

✔️

✔️

✔️

mindspore.mint

✔️

mindspore.mint.nn.functional

✔️