torch.nn.functional

查看源文件

Convolution functions

API名称

API状态

限制与说明

conv1d

Beta

支持数据类型:fp16、fp32

conv2d

Beta

支持数据类型:bf16、fp16、fp32

conv3d

Stable

N/A

conv_transpose1d

Not Support

N/A

conv_transpose2d

Demo

不支持CPU平台

conv_transpose3d

Not Support

N/A

unfold

Stable

N/A

fold

Stable

N/A

Pooling functions

API名称

API状态

限制与说明

avg_pool1d

Beta

支持数据类型:fp16、fp32

avg_pool2d

Stable

divisor_override默认值torch为None,msadapter为0;支持数据类型:fp16、fp32

avg_pool3d

Not Support

N/A

max_pool1d

Beta

N/A

max_pool2d

Stable

N/A

max_pool3d

Stable

N/A

max_unpool1d

Not Support

N/A

max_unpool2d

Not Support

N/A

max_unpool3d

Not Support

N/A

lp_pool1d

Not Support

N/A

lp_pool2d

Not Support

N/A

lp_pool3d

Not Support

N/A

adaptive_max_pool1d

Not Support

N/A

adaptive_max_pool2d

Not Support

N/A

adaptive_max_pool3d

Not Support

N/A

adaptive_avg_pool1d

Not Support

N/A

adaptive_avg_pool2d

Not Support

N/A

adaptive_avg_pool3d

Not Support

N/A

fractional_max_pool2d

Not Support

N/A

fractional_max_pool3d

Not Support

N/A

Attention Mechanisms

API名称

API状态

限制与说明

scaled_dot_product_attention

Beta

N/A

Non-linear activation functions

API名称

API状态

限制与说明

threshold

Not Support

N/A

threshold_

Not Support

N/A

relu

Stable

支持数据类型:bf16、fp16、fp32、uint8、int8、int32、int64

relu_

Not Support

N/A

hardtanh

Not Support

N/A

hardtanh_

Not Support

N/A

hardswish

Beta

入参不支持inplace;支持数据类型:fp16、fp32

relu6

Beta

支持数据类型:fp16、fp32、uint8、int8、int16、int32、int64

elu

Beta

入参不支持inplace;支持数据类型:fp16、fp32

elu_

Not Support

N/A

selu

Beta

入参不支持inplace、支持数据类型:fp16、fp32

celu

Beta

支持数据类型:fp16、fp32

leaky_relu

Beta

入参不支持inplace;支持数据类型:bf16、fp16、fp32、fp64

leaky_relu_

Not Support

N/A

prelu

Stable

支持数据类型:fp16、fp32

rrelu

Not Support

N/A

rrelu_

Not Support

N/A

glu

Beta

支持数据类型:fp16、fp32

gelu

Stable

支持数据类型:bf16、fp16、fp32

logsigmoid

Stable

支持数据类型:fp16、fp32

hardshrink

Stable

支持数据类型:fp16、fp32

tanhshrink

Not Support

N/A

softsign

Not Support

N/A

softplus

Stable

支持数据类型:fp16、fp32

softmin

Not Support

N/A

softmax

Stable

入参不支持_stacklevel;支持数据类型:bf16、fp16、fp32

softshrink

Stable

支持数据类型:fp16、fp32

gumbel_softmax

Beta

N/A

log_softmax

Beta

入参不支持_stacklevel、dim默认值torch为None、msadapter为-1;支持数据类型:bf16、fp16、fp32

tanh

Stable

支持数据类型:fp16、fp32、uint8、int8、int16、int32、int64、bool

sigmoid

Stable

支持数据类型:fp16、fp32、uint8、int8、int16、int32、int64、bool

hardsigmoid

Beta

入参不支持inplace;支持数据类型:fp16、fp32

silu

Beta

入参不支持inplace;支持数据类型:fp16、fp32

mish

Stable

支持数据类型:fp16、fp32

batch_norm

Stable

支持数据类型:fp16、fp32

group_norm

Stable

支持数据类型:fp16、fp32

instance_norm

Not Support

N/A

layer_norm

Stable

支持数据类型:bf16、fp16、fp32

local_response_norm

Not Support

N/A

rms_norm

Beta

N/A

normalize

Beta

不支持out出参;支持数据类型:bf16、fp16、fp32

Linear functions

API名称

API状态

限制与说明

linear

Stable

支持数据类型:fp16、fp32

bilinear

Not Support

N/A

Dropout functions

API名称

API状态

限制与说明

dropout

Stable

支持数据类型:bf16、fp16、fp32

alpha_dropout

Not Support

N/A

feature_alpha_dropout

Not Support

N/A

dropout1d

Not Support

N/A

dropout2d

Beta

支持数据类型:bf16、fp16、fp32

dropout3d

Not Support

N/A

Sparse functions

API名称

API状态

限制与说明

embedding

Beta

入参不支持sparse;支持数据类型:int32、int64

embedding_bag

Not Support

N/A

one_hot

Stable

支持数据类型:int32、int64

Distance functions

API名称

API状态

限制与说明

pairwise_distance

Not Support

N/A

cosine_similarity

Beta

支持数据类型:fp16、fp32

pdist

Not Support

N/A

Loss functions

API名称

API状态

限制与说明

binary_cross_entropy

Not Support

N/A

binary_cross_entropy_with_logits

Stable

支持数据类型:fp16、fp32

poisson_nll_loss

Not Support

N/A

cosine_embedding_loss

Not Support

N/A

cross_entropy

Beta

入参不支持reduce、size_average;支持数据类型:fp16、fp32

ctc_loss

Not Support

N/A

gaussian_nll_loss

Not Support

N/A

hinge_embedding_loss

Not Support

N/A

kl_div

Beta

支持数据类型:bf16、fp16、fp32

l1_loss

Stable

支持数据类型:fp16、fp32

mse_loss

Beta

入参不支持reduce、size_average;支持数据类型:fp16、fp32

margin_ranking_loss

Not Support

N/A

multilabel_margin_loss

Not Support

N/A

multilabel_soft_margin_loss

Not Support

N/A

multi_margin_loss

Not Support

N/A

nll_loss

Beta

支持数据类型:fp32

huber_loss

Not Support

N/A

smooth_l1_loss

Beta

入参不支持reduce、size_average;支持数据类型:fp16、fp32

soft_margin_loss

Not Support

N/A

triplet_margin_loss

Not Support

N/A

triplet_margin_with_distance_loss

Not Support

N/A

Vision functions

API名称

API状态

限制与说明

pixel_shuffle

Beta

支持数据类型:bf16、fp16、fp32、fp64、uint8、int8、int16、int32、int64、bool

pixel_unshuffle

Beta

支持数据类型:bf16、fp16、fp32、fp64、uint8、int8、int16、int32、int64、bool

pad

Beta

value默认值torch为None,msadapter为0;
属性mode为constant时,支持bf16、fp16、fp32、fp64、uint8、int8、int16、int32、int64、bool;
属性mode非constant时,支持fp16、fp32、fp64

interpolate

Stable

N/A

upsample

Not Support

N/A

upsample_nearest

Not Support

N/A

upsample_bilinear

Not Support

N/A

grid_sample

Stable

align_corners默认值torch为None、msadapter为False

affine_grid

Not Support

N/A