Copy
tensorplay.nn.functional
Convolution functions
Applies a 1D convolution over an input signal composed of several input planes. |
|
Applies a 2D convolution over an input image composed of several input planes. |
|
Applies a 3D convolution over an input image composed of several input planes. |
|
Extract sliding local blocks from a batched input tensor (torch F.unfold, i.e. aten::im2col). |
|
Combine an array of sliding local blocks into a tensor containing them all (torch F.fold, i.e. aten::col2im). |
Pooling functions
avg_pool1d(input, kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None) -> Tensor |
|
avg_pool3d(input, kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None) -> Tensor |
|
max_pool1d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False) -> Tensor |
|
max_pool3d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False) -> Tensor |
|
Compute a partial inverse of |
|
Compute a partial inverse of |
|
Compute a partial inverse of |
|
Apply a 1D power-average pooling over an input signal. |
|
Apply a 2D power-average pooling over an input signal. |
|
Apply a 3D power-average pooling over an input signal. |
|
Apply a 3D adaptive average pooling over an input signal. |
|
Applies 2D fractional max pooling over an input signal. |
|
Applies 3D fractional max pooling over an input signal. |
Attention Mechanisms
scaled_dot_product_attention(query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False, scale=None, backend=None) -> Tensor |
Non-linear activation functions
Apply a threshold to each element of the input Tensor. |
|
ReLU6: \(\min(\max(0, x), 6)\) — torch.nn.functional.relu6. |
|
Randomized leaky ReLU. |
|
Gated Linear Unit: \(a * \sigma(b)\) where the input is split in half along |
|
When approximate is 'none', applies \(\text{GELU}(x) = x * \Phi(x)\); 'tanh' uses the tanh estimation. |
|
Applies element-wise \(\text{LogSigmoid}(x_i) = \log \left(\frac{1}{1 + \exp(-x_i)}\right)\) |
|
Applies the hard shrinkage function element-wise. |
|
Applies element-wise, \(\text{Tanhshrink}(x) = x - \text{Tanh}(x)\) |
|
Applies element-wise, the function \(\text{SoftSign}(x) = \frac{x}{1 + |x|}\) |
|
Apply a softmin function. |
|
Applies the soft shrinkage function element-wise. |
|
Sample from the Gumbel-Softmax distribution and optionally discretize. |
|
Applies element-wise \(\text{Tanh}(x) = \frac{\exp(x) - \exp(-x)}{\exp(x) + \exp(-x)}\) |
|
Applies the element-wise function \(\text{Sigmoid}(x) = \frac{1}{1 + \exp(-x)}\) |
|
Apply the Sigmoid Linear Unit (SiLU) function, element-wise. |
|
Apply local response normalization over an input signal. |
|
Apply Root Mean Square Layer Normalization — composed per the ATen rms_norm composite (fp32 compute for reduced dtypes). |
|
Performs \(L_p\) normalization over the specified dimension — torch.nn.functional.normalize divides by clamp_min(norm, eps). |
Linear functions
Applies a linear transformation to the incoming data: \(y = xA^T + b\). |
|
Dropout functions
Randomly masks out entire channels, setting activations to the negative saturation value of the SELU activation function. |
|
Randomly zero out entire channels (a channel is a 1D feature map). |
|
Sparse functions
Compute sums, means or maxes of |
|
Returns long tensor shaped |
Distance functions
Computes the pairwise distance between input vectors. |
|
Returns cosine similarity between x1 and x2, computed along dim. |
|
Computes the pairwise distance between rows of |
Loss functions
Compute Binary Cross Entropy between the target and input probabilities. |
|
Compute Binary Cross Entropy between target and input logits. |
|
Compute the Poisson negative log likelihood loss. |
|
Compute the cosine embedding loss. |
|
Compute the cross entropy loss between input logits and target. |
|
Compute the Connectionist Temporal Classification loss. |
|
Compute the Gaussian negative log likelihood loss. |
|
Compute the hinge embedding loss. |
|
Compute the KL Divergence loss. |
|
Compute the L1 loss, with optional weighting. |
|
Compute cross entropy between |
|
Compute the margin ranking loss. |
|
Compute the multilabel margin loss. |
|
Compute the multilabel soft margin loss. |
|
Compute the multi margin loss, with optional weighting. |
|
The negative log likelihood loss. |
|
Compute the Huber loss, with optional weighting. |
|
Compute the Smooth L1 loss. |
|
Compute the soft margin loss. |
|
Compute the triplet loss between given input tensors and a margin greater than 0. |
|
Compute the triplet margin loss using a custom distance function. |
Vision functions
Rearranges elements in a tensor of shape |
|
Reverses the |
|
Pads tensor. |
|
interpolate(input, size=None, scale_factor=None, mode='nearest', align_corners=None) -> Tensor |
|
Upsamples the input to the given |
|
Upsamples the input using nearest neighbours. |
|
Upsamples the input using bilinear upsampling. |
|
Compute grid sample. |
|
Generate 2D or 3D flow field (sampling grid), given a batch of affine matrices |
data_parallel
Low-Precision functions
TensorPlay-specific additions
Members: |
|
alias of |
|
Applies a 1D adaptive max pooling over an input signal, returning |
|
Applies a 2D adaptive max pooling over an input signal composed of several input planes, returning |
|
Applies a 3D adaptive max pooling over an input signal, returning |
|
Divide the channels in a tensor into |
|
Applies a 1D convolution over an input of shape (T, B, C) along the time dimension (torch.conv_tbc). |
|
Applies 2D fractional max pooling over an input signal composed of several input planes, returning |
|
Applies 3D fractional max pooling over an input signal composed of several input planes, returning |
|
Applies a 1D max pooling over an input signal, returning |
|
Applies a 2D max pooling over an input composed of several input planes, returning |
|
Applies a 3D max pooling over an input signal, returning |
|
torch-compatible multi_head_attention_forward. |
|
Native channel shuffle primitive (torch.native_channel_shuffle). |
Help improve this page
Found an error, an unclear step, or a missing example?
