torch.nn

Parameters

Containers

Module

Sequential

ModuleList

ParameterList

Convolution Layers

Conv1d

Conv2d

Conv3d

ConvTranspose1d

ConvTranspose2d

ConvTranspose3d

Pooling Layers

MaxPool1d

MaxPool2d

MaxPool3d

MaxUnpool1d

MaxUnpool2d

MaxUnpool3d

AvgPool1d

AvgPool2d

AvgPool3d

FractionalMaxPool2d

LPPool2d

AdaptiveMaxPool1d

AdaptiveMaxPool2d

AdaptiveMaxPool3d

AdaptiveAvgPool1d

AdaptiveAvgPool2d

AdaptiveAvgPool3d

Padding Layers

ReflectionPad2d

ReplicationPad2d

ReplicationPad3d

ZeroPad2d

ConstantPad2d

Non-linear Activations

ReLU

ReLU6

ELU

SELU

PReLU

LeakyReLU

Threshold

Hardtanh

Sigmoid

Tanh

LogSigmoid

Softplus

Softshrink

Softsign

Tanhshrink

Softmin

Softmax

Softmax2d

LogSoftmax

Normalization layers

BatchNorm1d

BatchNorm2d

BatchNorm3d

InstanceNorm1d

InstanceNorm2d

InstanceNorm3d

Recurrent layers

RNN

LSTM

GRU

RNNCell

LSTMCell

GRUCell

Linear layers

Linear

Bilinear

Dropout layers

Dropout

Dropout2d

Dropout3d

AlphaDropout

Sparse layers

Embedding

EmbeddingBag

Distance functions

CosineSimilarity

PairwiseDistance

Loss functions

L1Loss

MSELoss

CrossEntropyLoss

NLLLoss

PoissonNLLLoss

NLLLoss2d

KLDivLoss

BCELoss

BCEWithLogitsLoss

MarginRankingLoss

HingeEmbeddingLoss

MultiLabelMarginLoss

SmoothL1Loss

SoftMarginLoss

MultiLabelSoftMarginLoss

CosineEmbeddingLoss

MultiMarginLoss

TripletMarginLoss

Vision layers

PixelShuffle

Upsample

UpsamplingNearest2d

UpsamplingBilinear2d

DataParallel layers (multi-GPU, distributed)

DataParallel

DistributedDataParallel

Utilities

clip_grad_norm

weight_norm

remove_weight_norm

PackedSequence

pack_padded_sequence

pad_packed_sequence

torch.nn.functional

Convolution functions

conv1d

conv2d

conv3d

conv_transpose1d

conv_transpose2d

conv_transpose3d

Pooling functions

avg_pool1d

avg_pool2d

avg_pool3d

max_pool1d

max_pool2d

max_pool3d

max_unpool1d

max_unpool2d

max_unpool3d

lp_pool2d

adaptive_max_pool1d

adaptive_max_pool2d

adaptive_max_pool3d

adaptive_avg_pool1d

adaptive_avg_pool2d

adaptive_avg_pool3d

Non-linear activation functions

threshold

relu

hardtanh

relu6

elu

selu

leaky_relu

prelu

rrelu

glu

logsigmoid

hardshrink

tanhshrink

softsign

softplus

softmin

softmax

softshrink

log_softmax

tanh

sigmoid

Normalization functions

batch_norm

normalize

Linear functions

linear

Dropout functions

dropout

alpha_dropout

dropout2d

dropout3d

Distance functions

pairwise_distance

cosine_similarity

Loss functions

binary_cross_entropy

poisson_nll_loss

cosine_embedding_loss

cross_entropy

hinge_embedding_loss

kl_div

l1_loss

mse_loss

margin_ranking_loss

multilabel_margin_loss

multilabel_soft_margin_loss

multi_margin_loss

nll_loss

binary_cross_entropy_with_logits

smooth_l1_loss

soft_margin_loss

triplet_margin_loss

Vision functions

pixel_shuffle

pad

upsample

upsample_nearest

upsample_bilinear

grid_sample

affine_grid

torch.nn.init