Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Diag = Diag Int
- data CeilMode
- data KeepDim
- newtype Dim = Dim Int
- data Reduction
- data Tri
- kOne :: ForeignPtr Scalar
- isUpper :: Tri -> Bool
- mean :: Tensor -> Tensor
- std :: Tensor -> Tensor
- var :: Tensor -> Tensor
- sumAll :: Tensor -> Tensor
- abs :: Tensor -> Tensor
- frac :: Tensor -> Tensor
- keepdim :: KeepDim -> Bool
- argmax :: Dim -> KeepDim -> Tensor -> Tensor
- add :: Tensor -> Tensor -> Tensor
- mul :: Tensor -> Tensor -> Tensor
- sub :: Tensor -> Tensor -> Tensor
- div :: Tensor -> Tensor -> Tensor
- ceil :: Tensor -> Tensor
- floor :: Tensor -> Tensor
- min :: Tensor -> Tensor
- max :: Tensor -> Tensor
- median :: Tensor -> Tensor
- addScalar :: Scalar a => a -> Tensor -> Tensor
- subScalar :: Scalar a => a -> Tensor -> Tensor
- mulScalar :: Scalar a => a -> Tensor -> Tensor
- divScalar :: Scalar a => a -> Tensor -> Tensor
- matmul :: Tensor -> Tensor -> Tensor
- embedding :: Bool -> Bool -> Tensor -> Int -> Tensor -> Tensor
- embedding' :: Tensor -> Tensor -> Tensor
- oneHot :: Int -> Tensor -> Tensor
- erf :: Tensor -> Tensor
- erfc :: Tensor -> Tensor
- erfinv :: Tensor -> Tensor
- lgamma :: Tensor -> Tensor
- digamma :: Tensor -> Tensor
- polygamma :: Int -> Tensor -> Tensor
- mvlgamma :: Int -> Tensor -> Tensor
- exp :: Tensor -> Tensor
- log1p :: Tensor -> Tensor
- log2 :: Tensor -> Tensor
- log :: Tensor -> Tensor
- log10 :: Tensor -> Tensor
- pow :: Scalar a => a -> Tensor -> Tensor
- powt :: Tensor -> Tensor -> Tensor
- relu :: Tensor -> Tensor
- elu :: Scalar s => s -> Tensor -> Tensor
- elu' :: Tensor -> Tensor
- selu :: Tensor -> Tensor
- celu :: Float -> Tensor -> Tensor
- sigmoid :: Tensor -> Tensor
- softmax :: Dim -> Tensor -> Tensor
- logSoftmax :: Dim -> Tensor -> Tensor
- threshold :: Float -> Float -> Tensor -> Tensor
- sin :: Tensor -> Tensor
- cos :: Tensor -> Tensor
- tan :: Tensor -> Tensor
- sinh :: Tensor -> Tensor
- cosh :: Tensor -> Tensor
- tanh :: Tensor -> Tensor
- sqrt :: Tensor -> Tensor
- gt :: Tensor -> Tensor -> Tensor
- (>.) :: Tensor -> Tensor -> Tensor
- lt :: Tensor -> Tensor -> Tensor
- (<.) :: Tensor -> Tensor -> Tensor
- ge :: Tensor -> Tensor -> Tensor
- (>=.) :: Tensor -> Tensor -> Tensor
- le :: Tensor -> Tensor -> Tensor
- (<=.) :: Tensor -> Tensor -> Tensor
- eq :: Tensor -> Tensor -> Tensor
- (==.) :: Tensor -> Tensor -> Tensor
- take :: Tensor -> Tensor -> Tensor
- maskedSelect :: Tensor -> Tensor -> Tensor
- nonzero :: Tensor -> Tensor
- isclose :: Double -> Double -> Bool -> Tensor -> Tensor -> Tensor
- isnan :: Tensor -> Tensor
- isNonzero :: Tensor -> Bool
- isSameSize :: Tensor -> Tensor -> Bool
- isSigned :: Tensor -> Bool
- ne :: Tensor -> Tensor -> Tensor
- (/=.) :: Tensor -> Tensor -> Tensor
- toDType :: DType -> Tensor -> Tensor
- squeezeAll :: Tensor -> Tensor
- squeezeDim :: Int -> Tensor -> Tensor
- cummax :: Int -> Tensor -> (Tensor, Tensor)
- cummin :: Int -> Tensor -> (Tensor, Tensor)
- cumprod :: Int -> DType -> Tensor -> Tensor
- cumsum :: Int -> DType -> Tensor -> Tensor
- binaryCrossEntropyLoss :: Reduction -> Tensor -> Tensor -> Tensor -> Tensor
- binaryCrossEntropyLoss' :: Tensor -> Tensor -> Tensor
- binaryCrossEntropyWithLogits :: Reduction -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor
- mseLoss :: Tensor -> Tensor -> Tensor
- nllLoss' :: Tensor -> Tensor -> Tensor
- cosineSimilarity :: Dim -> Double -> Tensor -> Tensor -> Tensor
- cosineSimilarity' :: Tensor -> Tensor -> Tensor
- ctcLoss :: Bool -> Int -> Reduction -> [Int] -> [Int] -> Tensor -> Tensor -> Tensor
- ctcLoss' :: Reduction -> [Int] -> [Int] -> Tensor -> Tensor -> Tensor
- dist :: Float -> Tensor -> Tensor -> Tensor
- hingeEmbeddingLoss :: Double -> Reduction -> Tensor -> Tensor -> Tensor
- marginRankingLoss :: Tensor -> Tensor -> Tensor -> Double -> Reduction -> Tensor
- nllLoss2D :: Reduction -> Int -> Tensor -> Tensor -> Tensor -> Tensor
- multiMarginLoss :: Reduction -> Float -> Float -> Tensor -> Tensor -> Tensor -> Tensor
- multiLabelMarginLoss :: Reduction -> Tensor -> Tensor -> Tensor
- klDiv :: Reduction -> Tensor -> Tensor -> Tensor
- smoothL1Loss :: Reduction -> Tensor -> Tensor -> Tensor
- softMarginLoss :: Reduction -> Tensor -> Tensor -> Tensor
- adaptiveMaxPool1d :: Int -> Tensor -> (Tensor, Tensor)
- adaptiveMaxPool2d :: (Int, Int) -> Tensor -> (Tensor, Tensor)
- adaptiveMaxPool3d :: (Int, Int) -> Tensor -> (Tensor, Tensor)
- maxPool1dWithIndices :: Int -> Int -> Int -> Int -> CeilMode -> Tensor -> (Tensor, Tensor)
- maxPool1d :: Int -> Int -> Int -> Int -> CeilMode -> Tensor -> Tensor
- maxPool2d :: (Int, Int) -> (Int, Int) -> (Int, Int) -> (Int, Int) -> CeilMode -> Tensor -> Tensor
- maxPool3d :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int) -> CeilMode -> Tensor -> Tensor
- maxPool2dDim :: (Int, Int) -> (Int, Int) -> (Int, Int) -> (Int, Int) -> CeilMode -> (Int, Int) -> (Int, Int)
- avgPool1d :: Int -> Int -> Int -> CeilMode -> Bool -> Tensor -> Tensor
- avgPool1d' :: Int -> Int -> Int -> Tensor -> Tensor
- adaptiveAvgPool1d :: Int -> Tensor -> Tensor
- adaptiveAvgPool2d :: (Int, Int) -> Tensor -> Tensor
- adaptiveAvgPool3d :: (Int, Int, Int) -> Tensor -> Tensor
- inverse :: Tensor -> Tensor
- triangularSolve :: Tensor -> Bool -> Bool -> Bool -> Tensor -> (Tensor, Tensor)
- symeig :: Bool -> Tri -> Tensor -> (Tensor, Tensor)
- eig :: Bool -> Tensor -> (Tensor, Tensor)
- svd :: Bool -> Bool -> Tensor -> (Tensor, Tensor, Tensor)
- cholesky :: Tri -> Tensor -> Tensor
- choleskySolve :: Tri -> Tensor -> Tensor -> Tensor
- solve :: Tensor -> Tensor -> (Tensor, Tensor)
- choleskyInverse :: Tri -> Tensor -> Tensor
- geqrf :: Tensor -> (Tensor, Tensor)
- orgqr :: Tensor -> Tensor -> Tensor
- ormqr :: Tensor -> Tensor -> Bool -> Bool -> Tensor -> Tensor
- luSolve :: Tensor -> Tensor -> Tensor -> Tensor
- dropout :: Double -> Bool -> Tensor -> IO Tensor
- featureDropout :: Double -> Bool -> Tensor -> IO Tensor
- alphaDropout :: Double -> Bool -> Tensor -> IO Tensor
- featureAlphaDropout :: Double -> Bool -> Tensor -> IO Tensor
- bitwiseNot :: Tensor -> Tensor
- logicalNot :: Tensor -> Tensor
- logicalXor :: Tensor -> Tensor -> Tensor
- logicalAnd :: Tensor -> Tensor -> Tensor
- logicalOr :: Tensor -> Tensor -> Tensor
- cat :: Dim -> [Tensor] -> Tensor
- index :: [Tensor] -> Tensor -> Tensor
- indexCopy :: Int -> Tensor -> Tensor -> Tensor -> Tensor
- indexCopyWithDimname :: Dimname -> Tensor -> Tensor -> Tensor -> Tensor
- indexPut :: Bool -> [Tensor] -> Tensor -> Tensor -> Tensor
- chunk :: Int -> Dim -> Tensor -> [Tensor]
- clamp :: Float -> Float -> Tensor -> Tensor
- clampMax :: Float -> Tensor -> Tensor
- clampMin :: Float -> Tensor -> Tensor
- cudnnIsAcceptable :: Tensor -> Bool
- constantPadNd1d :: [Int] -> Float -> Tensor -> Tensor
- conv1d :: Tensor -> Tensor -> Int -> Int -> Int -> Int -> Tensor -> Tensor
- conv1d' :: Tensor -> Tensor -> Int -> Int -> Tensor -> Tensor
- conv2d :: Tensor -> Tensor -> (Int, Int) -> (Int, Int) -> (Int, Int) -> Int -> Tensor -> Tensor
- conv2d' :: Tensor -> Tensor -> (Int, Int) -> (Int, Int) -> Tensor -> Tensor
- conv3d :: Tensor -> Tensor -> (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int) -> Int -> Tensor -> Tensor
- conv3d' :: Tensor -> Tensor -> (Int, Int, Int) -> (Int, Int, Int) -> Tensor -> Tensor
- convTranspose1d :: Tensor -> Tensor -> Int -> Int -> Int -> Int -> Tensor -> Tensor
- convTranspose1d' :: Tensor -> Tensor -> Int -> Int -> Tensor -> Tensor
- convTranspose2d :: Tensor -> Tensor -> (Int, Int) -> (Int, Int) -> (Int, Int) -> Int -> Tensor -> Tensor
- convTranspose2d' :: Tensor -> Tensor -> (Int, Int) -> (Int, Int) -> Tensor -> Tensor
- convTranspose3d :: Tensor -> Tensor -> (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int) -> Int -> Tensor -> Tensor
- convTranspose3d' :: Tensor -> Tensor -> (Int, Int, Int) -> (Int, Int, Int) -> Tensor -> Tensor
- sign :: Tensor -> Tensor
- transpose :: Dim -> Dim -> Tensor -> Tensor
- transpose2D :: Tensor -> Tensor
- diag :: Diag -> Tensor -> Tensor
- diagEmbed :: Diag -> Dim -> Dim -> Tensor -> Tensor
- diagflat :: Diag -> Tensor -> Tensor
- diagonal :: Diag -> Dim -> Dim -> Tensor -> Tensor
- all :: Tensor -> Bool
- any :: Tensor -> Bool
- allDim :: Dim -> Bool -> Tensor -> Tensor
- anyDim :: Dim -> Bool -> Tensor -> Tensor
- permute :: [Int] -> Tensor -> Tensor
- expand :: Tensor -> Bool -> [Int] -> Tensor
- flatten :: Dim -> Dim -> Tensor -> Tensor
- flattenAll :: Tensor -> Tensor
- lstm :: Tensor -> [Tensor] -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> Bool -> (Tensor, Tensor, Tensor)
- lstm' :: Tensor -> [Tensor] -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> Tensor -> (Tensor, Tensor, Tensor)
- gru :: Tensor -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> Bool -> Tensor -> (Tensor, Tensor)
- gru' :: Tensor -> Tensor -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> Tensor -> (Tensor, Tensor)
- rnnTanh :: Tensor -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> Bool -> Tensor -> (Tensor, Tensor)
- rnnTanh' :: Tensor -> Tensor -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> Tensor -> (Tensor, Tensor)
- rnnRelu :: Tensor -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> Bool -> Tensor -> (Tensor, Tensor)
- rnnRelu' :: Tensor -> Tensor -> Tensor -> [Tensor] -> Bool -> Int -> Double -> Bool -> Bool -> (Tensor, Tensor)
- lstmCell :: Tensor -> Tensor -> Tensor -> Tensor -> (Tensor, Tensor) -> Tensor -> (Tensor, Tensor)
- gruCell :: Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor
- rnnTanhCell :: Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor
- rnnReluCell :: Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor
- quantizedLstmCell :: Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Float -> Float -> Float -> Float -> (Tensor, Tensor) -> Tensor -> (Tensor, Tensor)
- quantizedGruCell :: Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Float -> Float -> Float -> Float -> Tensor -> Tensor -> Tensor
- quantizedRnnReluCell :: Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Float -> Float -> Float -> Float -> Tensor -> Tensor -> Tensor
- quantizedRnnTanhCell :: Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Tensor -> Float -> Float -> Float -> Float -> Tensor -> Tensor -> Tensor
- softShrink :: Float -> Tensor -> Tensor
- stack :: Dim -> [Tensor] -> Tensor
- sumDim :: Dim -> KeepDim -> DType -> Tensor -> Tensor
- topK :: Int -> Dim -> Bool -> Bool -> Tensor -> (Tensor, Tensor)
- logsumexp :: Bool -> Int -> Tensor -> Tensor
- triu :: Diag -> Tensor -> Tensor
- tril :: Diag -> Tensor -> Tensor
- trunc :: Tensor -> Tensor
- uniqueDim :: Int -> Bool -> Bool -> Bool -> Tensor -> (Tensor, Tensor, Tensor)
- uniqueConsecutive :: Bool -> Bool -> Int -> Tensor -> (Tensor, Tensor, Tensor)
- uniqueDimConsecutive :: Int -> Bool -> Bool -> Tensor -> (Tensor, Tensor, Tensor)
- unsqueeze :: Dim -> Tensor -> Tensor
- upsampleBilinear2d :: (Int, Int) -> Bool -> Tensor -> Tensor
- upsampleNearest2d :: (Int, Int) -> Double -> Double -> Tensor -> Tensor
- split :: Int -> Dim -> Tensor -> [Tensor]
- l1Loss :: Reduction -> Tensor -> Tensor -> Tensor
- leakyRelu :: Float -> Tensor -> Tensor
- logSigmoid :: Tensor -> Tensor
- maxDim :: Dim -> KeepDim -> Tensor -> (Tensor, Tensor)
- minDim :: Dim -> KeepDim -> Tensor -> (Tensor, Tensor)
- meanDim :: Dim -> KeepDim -> DType -> Tensor -> Tensor
- medianDim :: Dim -> KeepDim -> Tensor -> (Tensor, Tensor)
- chainMatmul :: [Tensor] -> Tensor
- gelu :: Tensor -> Tensor
- glu :: Dim -> Tensor -> Tensor
- stdMean :: Bool -> Tensor -> (Tensor, Tensor)
- stdMeanDim :: Dim -> Bool -> KeepDim -> Tensor -> (Tensor, Tensor)
- clone :: Tensor -> IO Tensor
- detach :: Tensor -> IO Tensor
- view :: [Int] -> Tensor -> Tensor
- repeat :: [Int] -> Tensor -> Tensor
- batchNormIO :: Tensor -> Tensor -> MutableTensor -> MutableTensor -> Bool -> Double -> Double -> Tensor -> IO Tensor
- instanceNormIO :: Tensor -> Tensor -> MutableTensor -> MutableTensor -> Bool -> Double -> Double -> Tensor -> IO Tensor
- repeatInterleaveRange :: Tensor -> Tensor
- repeatInterleave :: Tensor -> Tensor -> Int -> Tensor
- repeatInterleaveScalar :: Tensor -> Int -> Int -> Tensor
- acos :: Tensor -> Tensor
- addmv :: Tensor -> Tensor -> Tensor -> Float -> Float -> Tensor
- addr :: Tensor -> Tensor -> Tensor -> Float -> Float -> Tensor
- allclose :: Tensor -> Tensor -> Double -> Double -> Bool -> Bool
- argmin :: Tensor -> Int -> Bool -> Tensor
- asin :: Tensor -> Tensor
- atan :: Tensor -> Tensor
- baddbmm :: Tensor -> Tensor -> Tensor -> Float -> Float -> Tensor
- bmm :: Tensor -> Tensor -> Tensor
- conj :: Tensor -> Tensor
- det :: Tensor -> Tensor
- dot :: Tensor -> Tensor -> Tensor
- einsum :: String -> [Tensor] -> Tensor
- expm1 :: Tensor -> Tensor
- ger :: Tensor -> Tensor -> Tensor
- logdet :: Tensor -> Tensor
- lstsq :: Tensor -> Tensor -> (Tensor, Tensor)
- mv :: Tensor -> Tensor -> Tensor
- sumWithDimnames :: Tensor -> [Dimname] -> Bool -> DType -> Tensor
Documentation
Instances
Show Reduction Source # | |
Eq Reduction Source # | |
KnownReduction 'ReduceMean Source # | |
Defined in Torch.Typed.Functional reductionVal :: Int Source # | |
KnownReduction 'ReduceNone Source # | |
Defined in Torch.Typed.Functional reductionVal :: Int Source # | |
KnownReduction 'ReduceSum Source # | |
Defined in Torch.Typed.Functional reductionVal :: Int Source # | |
Castable Reduction Int64 Source # | |
kOne :: ForeignPtr Scalar Source #
Returns the mean value of all elements in the input tensor.
Returns the standard deviation of all elements in the input tensor.
Computes the element-wise absolute value of the given input tensor.
Computes the fractional portion of each element in input. out_i = input_i - (floor . abs) input_i * (sign input_i)
:: Dim | the dimension to reduce |
-> KeepDim | whether the output tensor has dim retained or not |
-> Tensor | input |
-> Tensor | output |
Returns the indices of the maximum value of all elements in the input tensor.
Each element of the tensor other added to each element of the tensor input. The resulting tensor is returned.
Multiplies each element of the tensor other to each element of the input tensor and returns a new resulting tensor.
Element wise subtraction of other tensor from input tensor and returns a new resulting tensor
Element wise division of input tensor by other tensor and returns a new resulting tensor
Adds each element of the input input with the scalar and returns a new resulting tensor.
Subtracts each element of the input input with the scalar and returns a new resulting tensor.
Multiplies each element of the input input with the scalar and returns a new resulting tensor.
Divides each element of the input input with the scalar and returns a new resulting tensor.
:: Tensor | first tensor for matrix multiplication |
-> Tensor | second tensor for matrix multiplication |
-> Tensor | output |
Matrix product of two tensors.
The behavior depends on the dimensionality of the tensors as follows:
If both tensors are 1-dimensional, the dot product (scalar) is returned. If both arguments are 2-dimensional, the matrix-matrix product is returned. If the first argument is 1-dimensional and the second argument is 2-dimensional, a 1 is prepended to its dimension for the purpose of the matrix multiply. After the matrix multiply, the prepended dimension is removed. If the first argument is 2-dimensional and the second argument is 1-dimensional, the matrix-vector product is returned. If both arguments are at least 1-dimensional and at least one argument is N-dimensional (where N > 2), then a batched matrix multiply is returned. If the first argument is 1-dimensional, a 1 is prepended to its dimension for the purpose of the batched matrix multiply and removed after. If the second argument is 1-dimensional, a 1 is appended to its dimension for the purpose of the batched matrix multiple and removed after. The non-matrix (i.e. batch) dimensions are broadcasted (and thus must be broadcastable). For example, if input is a (j times 1 times n times m)(j×1×n×m) tensor and other is a (k times m times p)(k×m×p) tensor, out will be an (j times k times n times p)(j×k×n×p) tensor.
:: Bool | whether or not to scale the gradient by the frequencies |
-> Bool | whether or not the embedding is sparse |
-> Tensor | weights |
-> Int | padding |
-> Tensor | indices |
-> Tensor | output |
A simple lookup table that looks up embeddings in a fixed dictionary and size. This module is often used to retrieve word embeddings using indices. The input to the module is a list of indices, and the embedding matrix, and the output is the corresponding word embeddings.
A one hot encoding of the given input. The encoding is based on the given number of classes.
Computes the complementary error function of each element of input
Computes the inverse error function of each element of input. The inverse error function is defined in the range (-1, 1)(−1,1) as: erfinv(erf(x)) = x
Computes the logarithmic derivative of the gamma function on input.
Computes the nth derivative of the digamma function on input. n geq 0n≥0 is called the order of the polygamma function.
Computes the multivariate log-gamma function with dimension pp element-wise. All elements must be greater than (p-1)/2, otherwise an error would be thrown.
Returns a new tensor with the exponential of the elements of the input tensor input.
Returns a new tensor with the logarithm to the base 2 of the elements of input.
Returns a new tensor with the natural logarithm of the elements of input.
Returns a new tensor with the logarithm to the base 10 of the elements of input.
Takes the power of each element in input with exponent and returns a tensor with the result.
Takes the power of each element in input with exponent and returns a tensor with the result. Exponent is a tensor with the same number of elements as input.
Applies Exponential linear unit function element-wise, with alpha input, \(\text{ELU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x) - 1))\)
Applies exponential linear unit function element wise with default alpha value = 1
Applies element-wise, \(\text{SELU}(x) = scale * (\max(0,x) + \min(0, \alpha * (\exp(x) - 1))\) , with α=1.6732632423543772848170429916717 and scale=1.0507009873554804934193349852946.
Applies element-wise, \(\text{CELU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1))\).
Applies a softmax function. It is applied to all slices along dim, and will re-scale them so that the elements lie in the range [0, 1] and sum to 1.
Applies a softmax followed by a logarithm. While mathematically equivalent to log(softmax(x)), doing these two operations separately is slower, and numerically unstable. This function uses an alternative formulation to compute the output and gradient correctly.
Thresholds each element of the input Tensor.
Returns a new tensor with the sine of the elements of input.
Returns a new tensor with the cos of the elements of input.
Returns a new tensor with the tangent of the elements of input.
Returns a new tensor with the hyperbolic sine of the elements of input.
Returns a new tensor with the hyperbolic cosine of the elements of input.
Returns a new tensor with the hyperbolic tangent of the elements of input.
Returns a new tensor with the square-root of the elements of input.
Computes input > other element-wise. The second argument can be a number or a tensor whose shape is broadcastable with the first argument.
Computes input < other element-wise. The second argument can be a number or a tensor whose shape is broadcastable with the first argument.
Computes input >= other element-wise. The second argument can be a number or a tensor whose shape is broadcastable with the first argument.
Computes input <= other element-wise. The second argument can be a number or a tensor whose shape is broadcastable with the first argument.
Computes input == other element-wise. The second argument can be a number or a tensor whose shape is broadcastable with the first argument.
Returns a new tensor with the elements of input at the given indices. The input tensor is treated as if it were viewed as a 1-D tensor. The result takes the same shape as the indices.
Returns a new 1-D tensor which indexes the input tensor according to the boolean mask mask which is a BoolTensor. The shapes of the mask tensor and the input tensor don’t need to match, but they must be broadcastable.
Returns a tuple of 1-D tensors, one for each dimension in input, each containing the indices (in that dimension) of all non-zero elements of input .
Computes input /= other element-wise. The second argument can be a number or a tensor whose shape is broadcastable with the first argument.
Casting to given Dtype
, where Dtype
is an object that represents the data type of a tensor in hasktorch.
Returns a tuple (values, indices) where values is the cumulative maximum of elements of input in the dimension dim. And indices is the index location of each maximum value found in the dimension dim.
Returns a tuple (values, indices) where values is the cumulative minimum of elements of input in the dimension dim. And indices is the index location of each maximum value found in the dimension dim.
Returns the cumulative product of elements of input in the dimension dim. For example, if input is a vector of size N, the result will also be a vector of size N, with elements.
Returns the cumulative sum of elements of input in the dimension dim. For example, if input is a vector of size N, the result will also be a vector of size N, with elements.
binaryCrossEntropyLoss Source #
:: Reduction | Specifies the reduction to apply to the output |
-> Tensor | target |
-> Tensor | weight |
-> Tensor | input |
-> Tensor | output |
Function that measures the Binary Cross Entropy between the target and the output.
binaryCrossEntropyLoss' Source #
Binary Cross Entropy with weights defaulted to 1.0 & reduction defaulted to ReduceMean
binaryCrossEntropyWithLogits Source #
:: Reduction | Specifies the reduction to apply to the output |
-> Tensor | target |
-> Tensor | weight |
-> Tensor | pos_weight |
-> Tensor | input |
-> Tensor | output |
This loss combines a Sigmoid layer and the BCELoss in one single class. This version is more numerically stable than using a plain Sigmoid followed by a BCELoss as, by combining the operations into one layer, we take advantage of the log-sum-exp trick for numerical stability.
Creates a criterion that measures the mean squared error (squared L2 norm) between each element in the input
and target
.
The negative log likelihood loss.
:: Dim | dimension of vectors (default=1) |
-> Double | small value to avoid division by 0 (default=1e-8) |
-> Tensor | x1 |
-> Tensor | x2 |
-> Tensor | output |
Returns cosine similarity between x1 and x2, computed along dim.
Returns cosine similarity with defaulted options.
:: Bool | zero_infinity - Whether to zero infinite losses and the associated gradients (False by default). Infinite losses mainly occur when the inputs are too short to be aligned to the targets. |
-> Int | blank label |
-> Reduction | reduction |
-> [Int] | input_lengths |
-> [Int] | target_lengths |
-> Tensor | log_probs |
-> Tensor | targets |
-> Tensor | output |
The Connectionist Temporal Classification loss. Calculates loss between a continuous (unsegmented) time series and a target sequence. CTCLoss sums over the probability of possible alignments of input to target, producing a loss value which is differentiable with respect to each input node. The alignment of input to target is assumed to be “many-to-one”, which limits the length of the target sequence such that it must be leq≤ the input length.
:: Reduction | reduction |
-> [Int] | input lengths |
-> [Int] | target lengths |
-> Tensor | log probs |
-> Tensor | targets |
-> Tensor | output |
Returns CTC loss with defaulted options.
Returns the p-norm of (input - other) The shapes of input and other must be broadcastable.
Measures the loss given an input tensor xx and a labels tensor yy (containing 1 or -1). This is usually used for measuring whether two inputs are similar or dissimilar, e.g. using the L1 pairwise distance as xx, and is typically used for learning nonlinear embeddings or semi-supervised learning.
nllLoss2D :: Reduction -> Int -> Tensor -> Tensor -> Tensor -> Tensor Source #
The 2D negative log likelihood loss
:: Reduction | reduction |
-> Float | p |
-> Float | margin |
-> Tensor | input |
-> Tensor | target |
-> Tensor | weight |
-> Tensor | output |
Creates a criterion that optimizes a multi-class classification hinge loss (margin-based loss) between input \(x\) (a 2D mini-batch Tensor) and output \(y\) (which is a 1D tensor of target class indices)
multiLabelMarginLoss :: Reduction -> Tensor -> Tensor -> Tensor Source #
Creates a criterion that optimizes a multi-label one-versus-all loss based on max-entropy, between input \(x\) and target \(y\) of size \((N,C)\) .
The Kullback-Leibler divergence Loss KL divergence is a useful distance measure for continuous distributions and is often useful when performing direct regression over the space of (discretely sampled) continuous output distributions. As with NLLLoss, the input given is expected to contain log-probabilities and is not restricted to a 2D Tensor. The targets are interpreted as probabilities by default, but could be considered as log-probabilities with log_target set to True. This criterion expects a target Tensor of the same size as the input Tensor.
Creates a criterion that uses a squared term if the absolute element-wise error falls below 1 and an L1 term otherwise. It is less sensitive to outliers than the MSELoss and in some cases prevents exploding gradients (e.g. see Fast R-CNN paper by Ross Girshick). Also known as the Huber loss.
Creates a criterion that optimizes a two-class classification logistic loss between input tensor \(x\) and target tensor \(y\) (containing 1 or -1).
Applies a 1D adaptive max pooling over an input signal composed of several input planes.
Applies a 2D adaptive max pooling over an input signal composed of several input planes.
Applies a 3D adaptive max pooling over an input signal composed of several input planes
:: Int | kernel size |
-> Int | stride |
-> Int | padding |
-> Int | dilation |
-> CeilMode | ceil mode |
-> Tensor | input |
-> (Tensor, Tensor) | output, indices |
maxPool1dWithIndices
:: Int | kernel size |
-> Int | stride |
-> Int | padding |
-> Int | dilation |
-> CeilMode | ceil mode |
-> Tensor | input |
-> Tensor | output |
Applies a 1D max pooling over an input signal composed of several input planes.
:: (Int, Int) | kernel size |
-> (Int, Int) | stride |
-> (Int, Int) | padding |
-> (Int, Int) | dilation |
-> CeilMode | ceil mode |
-> Tensor | input |
-> Tensor | output |
Applies a 2D max pooling over an input signal composed of several input planes.
:: (Int, Int, Int) | kernel size |
-> (Int, Int, Int) | stride |
-> (Int, Int, Int) | padding |
-> (Int, Int, Int) | dilation |
-> CeilMode | ceil mode |
-> Tensor | input |
-> Tensor | output |
Applies a 3D max pooling over an input signal composed of several input planes.
:: (Int, Int) | kernel size |
-> (Int, Int) | stride |
-> (Int, Int) | padding |
-> (Int, Int) | dilation |
-> CeilMode | Ceiling or Floor |
-> (Int, Int) | image dimensions |
-> (Int, Int) | height, width after maxPool |
Calculates resulting dimensions from a 2d maxpool operation see https://pytorch.org/docs/master/generated/torch.nn.MaxPool2d.html#torch.nn.MaxPool2d
:: Int | kernel size |
-> Int | stride |
-> Int | padding |
-> CeilMode | ceil mode |
-> Bool | count include pad |
-> Tensor | input |
-> Tensor | output |
Applies a 1D average pooling over an input signal composed of several input planes.
Applies a 1D adaptive average pooling over an input signal composed of several input planes.
Applies a 2D adaptive average pooling over an input signal composed of several input planes.
Applies a 3D adaptive average pooling over an input signal composed of several input planes.
Takes the inverse of the square matrix input. input
can be batches of 2D square tensors, in which case this function would return a tensor composed of individual inverses.
Solves a system of equations with a triangular coefficient matrix AA and multiple right-hand sides bb
:: Bool | bool which controls whether eigenvectors have to be computed |
-> Tri | controls whether to consider upper-triangular or lower-triangular region |
-> Tensor | input tensor |
-> (Tensor, Tensor) | output tensors |
This function returns eigenvalues and eigenvectors of a real symmetric matrix input or a batch of real symmetric matrices, represented by a namedtuple (eigenvalues, eigenvectors).
:: Bool | bool to compute both eigenvalues and eigenvectors; otherwise, only eigenvalues will be computed |
-> Tensor | input (square matrix) for which the eigen values and eigen vectors are to be computed |
-> (Tensor, Tensor) | output tensors |
Computes the eigenvalues and eigenvectors of a real square matrix
:: Bool | controls the shape of returned U and V |
-> Bool | option whether to compute U and V or not |
-> Tensor | input |
-> (Tensor, Tensor, Tensor) | output tuple of tensors |
This function returns a namedtuple (U, S, V) which is the singular value decomposition of a input real matrix or batches of real matrices input such that input = U * diag(S) * V^T
:: Tri | flag that indicates whether to return a upper or lower triangular matrix. |
-> Tensor | input |
-> Tensor | output |
Computes the Cholesky decomposition of a symmetric positive-definite matrix AA or for batches of symmetric positive-definite matrices.
:: Tri | bool whether to consider the Cholesky factor as a lower or upper triangular matrix |
-> Tensor | input matrix b |
-> Tensor | input matrix u |
-> Tensor | output |
Solves a linear system of equations with a positive semidefinite matrix to be inverted given its Cholesky factor matrix uu .
:: Tensor | input matrix |
-> Tensor | input square matrix |
-> (Tensor, Tensor) | output tuple with solution and LU |
This function returns the solution to the system of linear equations represented by AX = BAX=B and the LU factorization of A, in order as a namedtuple solution, LU. LU contains L and U factors for LU factorization of A
Solves a linear system of equations with a positive semidefinite matrix to be inverted given its Cholesky factor matrix uu .
:: Tensor | input |
-> (Tensor, Tensor) | a, tau output matrices (see https://software.intel.com/en-us/node/521004) |
This is a low-level function for calling LAPACK directly. This function returns a namedtuple (a, tau) as defined in LAPACK documentation for geqrf.
Computes the orthogonal matrix Q of a QR factorization, from the (input, input2)
tuple returned by geqrf
function.
This directly calls the underlying LAPACK function ?orgqr
. See LAPACK documentation for orgqr
for further details.
Multiplies mat (given by input3) by the orthogonal Q matrix of the QR factorization formed by torch.geqrf() that is represented by (a, tau) (given by (input, input2)). This directly calls the underlying LAPACK function ?ormqr. See LAPACK documentation for ormqr for further details.
Returns the LU solve of the linear system Ax = bAx=b using the partially pivoted LU factorization of A from torch.lu().
:: Double | dropout probability |
-> Bool | whether or not to activate dropout |
-> Tensor | input |
-> IO Tensor | output |
During training, randomly zeroes some of the elements of the input tensor with probability p using samples from a Bernoulli distribution.
:: Double | dropout probability |
-> Bool | whether or not to activate dropout |
-> Tensor | input |
-> IO Tensor | output |
Applies alpha dropout to the input.
Computes the bitwise NOT of the given input tensor. The input tensor must be of integral or Boolean types. For bool tensors, it computes the logical NOT.
Computes the element-wise logical NOT of the given input tensor. If not specified, the output tensor will have the bool dtype. If the input tensor is not a bool tensor, zeros are treated as False and non-zeros are treated as True.
Concatenates the given sequence of seq tensors in the given dimension. All tensors must either have the same shape (except in the concatenating dimension) or be empty.
Puts values from the tensor value into the input tensor (out-of-place) using the indices specified in indices (which is a tuple of Tensors). The expression tensor.index_put_(indices, value) is equivalent to tensor[indices] = value. If accumulate is True, the elements in value are added to self. If accumulate is False, the behavior is undefined if indices contain duplicate elements.
Splits a tensor into a specific number of chunks. Last chunk will be smaller if the tensor size along the given dimension dim is not divisible by chunks.
Clamp all elements in input into the range [ min, max ] and return a resulting tensor.
Clamps all elements in input to be smaller or equal max.
Clamps all elements in input to be larger or equal min.
Pads the input tensor boundaries with a constant value.
:: Tensor | weight |
-> Tensor | bias |
-> Int | stride |
-> Int | padding |
-> Int | dilation |
-> Int | groups |
-> Tensor | input |
-> Tensor | output |
Applies a 1D convolution over an input signal composed of several input planes.
:: Tensor | weight |
-> Tensor | bias |
-> (Int, Int) | strides |
-> (Int, Int) | padding |
-> (Int, Int) | dilation |
-> Int | groups |
-> Tensor | input |
-> Tensor | output |
Applies a 2D convolution over an input signal composed of several input planes.
:: Tensor | weight |
-> Tensor | bias |
-> (Int, Int, Int) | strides |
-> (Int, Int, Int) | padding |
-> (Int, Int, Int) | dilation |
-> Int | groups |
-> Tensor | input |
-> Tensor | output |
Applies a 3D convolution over an input signal composed of several input planes.
:: Tensor | weight |
-> Tensor | bias |
-> Int | strides |
-> Int | padding |
-> Int | output padding |
-> Int | groups |
-> Tensor | input |
-> Tensor | output |
Applies a 1D transposed convolution over an input signal composed of several input planes
:: Tensor | weight |
-> Tensor | bias |
-> (Int, Int) | strides |
-> (Int, Int) | padding |
-> (Int, Int) | output padding |
-> Int | groups |
-> Tensor | input |
-> Tensor | output |
Applies a 2D transposed convolution over an input signal composed of several input planes
:: Tensor | weight |
-> Tensor | bias |
-> (Int, Int, Int) | strides |
-> (Int, Int, Int) | padding |
-> (Int, Int, Int) | output padding |
-> Int | groups |
-> Tensor | input |
-> Tensor | output |
Applies a 3D transposed convolution over an input signal composed of several input planes
Returns a new tensor with the signs of the elements of input
Returns a tensor that is a transposed version of input
. The given dimensions dim0
and dim1
are swapped.
Returns a tensor with the elements of input as the diagonal. The second argument controls which diagonal to consider: If Int = 0, it is the main diagonal. If Int > 0, it is above the main diagonal. If Int < 0, it is below the main diagonal.
If input is a vector (1-D tensor), then returns a 2-D square tensor with the elements of input as the diagonal. If input is a tensor with more than one dimension, then returns a 2-D tensor with diagonal elements equal to a flattened input. The argument offset controls which diagonal to consider: If offset = 0, it is the main diagonal. If offset > 0, it is above the main diagonal. If offset < 0, it is below the main diagonal.
Returns a partial view of input with the its diagonal elements with respect to dim1 and dim2 appended as a dimension at the end of the shape. Applying diagEmbed to the output of this function with the same arguments yields a diagonal matrix with the diagonal entries of the input. However, diagEmbed has different default dimensions, so those need to be explicitly specified.
Returns True if all elements in the tensor are True, False otherwise.
Returns True if any elements in the tensor are True, False otherwise.
Returns True if all elements in each row of the tensor in the given dimension dim are True, False otherwise. If keepdim is True, the output tensor is of the same size as input except in the dimension dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 fewer dimension than input.
Returns True if any elements in each row of the tensor in the given dimension dim are True, False otherwise. If keepdim is True, the output tensor is of the same size as input except in the dimension dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 fewer dimension than input.
Permute the dimensions of this tensor.
:: Tensor | input |
-> Bool | some boolean value with unknown function |
-> [Int] | the desired expanded size |
-> Tensor | output |
expand
TODO: figure out what the implicit
boolean value does
:: Tensor | input-hidden weights (4*hidden_size, input_size) |
-> Tensor | hidden-hidden weights (4*hidden_size, hidden_size) |
-> Tensor | input-hidden bias (4*hidden_size) |
-> Tensor | hidden-hidden bias, of shape (4*hidden_size) |
-> (Tensor, Tensor) | hidden state |
-> Tensor | input |
-> (Tensor, Tensor) |
A long short-term memory (LSTM) cell.
:: Tensor | input-hidden weights |
-> Tensor | hidden-hidden weights |
-> Tensor | input-hidden bias |
-> Tensor | hidden-hidden bias |
-> Tensor | hidden state |
-> Tensor | input |
-> Tensor | output |
A gated recurrent unit (GRU) cell
:: Tensor | input-hidden weights |
-> Tensor | hidden-hidden weights |
-> Tensor | input-hidden bias |
-> Tensor | hidden-hidden bias |
-> Tensor | hidden state |
-> Tensor | input |
-> Tensor | output |
An Elman RNN cell with tanh non-linearity
:: Tensor | input-hidden weights |
-> Tensor | hidden-hidden weights |
-> Tensor | input-hidden bias |
-> Tensor | hidden-hidden bias |
-> Tensor | hidden state |
-> Tensor | input |
-> Tensor | output |
An Elman RNN cell with ReLU non-linearity
:: Tensor | input-hidden weights |
-> Tensor | hidden-hidden weights |
-> Tensor | input-hidden bias |
-> Tensor | hidden-hidden bias |
-> Tensor | input-hidden packed |
-> Tensor | hidden-hidden packed |
-> Tensor | input-hidden column offsets |
-> Tensor | hidden-hidden column offsets |
-> Float | input-hidden scale |
-> Float | hidden-hidden scale |
-> Float | input-hidden zero point |
-> Float | hidden-hidden zero point |
-> (Tensor, Tensor) | hidden state |
-> Tensor | input |
-> (Tensor, Tensor) | output |
A quantized long short-term memory (LSTM) cell.
:: Tensor | input-hidden weights |
-> Tensor | hidden-hidden weights |
-> Tensor | input-hidden bias |
-> Tensor | hidden-hidden bias |
-> Tensor | input-hidden packed |
-> Tensor | hidden-hidden packed |
-> Tensor | input-hidden column offsets |
-> Tensor | hidden-hidden column offsets |
-> Float | input-hidden scale |
-> Float | hidden-hidden scale |
-> Float | input-hidden zero point |
-> Float | hidden-hidden zero point |
-> Tensor | hidden state |
-> Tensor | input |
-> Tensor | output |
A quantized long gated recurrent unit (GRU) cell.
:: Tensor | input-hidden weights |
-> Tensor | hidden-hidden weights |
-> Tensor | input-hidden bias |
-> Tensor | hidden-hidden bias |
-> Tensor | input-hidden packed |
-> Tensor | hidden-hidden packed |
-> Tensor | input-hidden column offsets |
-> Tensor | hidden-hidden column offsets |
-> Float | input-hidden scale |
-> Float | hidden-hidden scale |
-> Float | input-hidden zero point |
-> Float | hidden-hidden zero point |
-> Tensor | hidden state |
-> Tensor | input |
-> Tensor | output |
A quantized Elman RNN cell with relu non-linearity
:: Tensor | input-hidden weights |
-> Tensor | hidden-hidden weights |
-> Tensor | input-hidden bias |
-> Tensor | hidden-hidden bias |
-> Tensor | input-hidden packed |
-> Tensor | hidden-hidden packed |
-> Tensor | input-hidden column offsets |
-> Tensor | hidden-hidden column offsets |
-> Float | input-hidden scale |
-> Float | hidden-hidden scale |
-> Float | input-hidden zero point |
-> Float | hidden-hidden zero point |
-> Tensor | hidden state |
-> Tensor | input |
-> Tensor | output |
A quantized Elman RNN cell with tanh non-linearity
Applies the soft shrinkage function elementwise
Concatenates sequence of tensors along a new dimension. All tensors need to be of the same size.
:: Dim | dim to sum along |
-> KeepDim | whether the output tensor has dim retained or not |
-> DType | datatype |
-> Tensor | input |
-> Tensor | output |
Returns the sum of each row of the input tensor in the given dimension dim. If keepdim is True, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 (or len(dim)) fewer dimension(s).
:: Int | k |
-> Dim | dim to find topK along |
-> Bool | largest |
-> Bool | sorted |
-> Tensor | input |
-> (Tensor, Tensor) | output |
Returns the k largest elements of the given input tensor along a given dimension. If largest is False then the k smallest elements are returned. The boolean option sorted if True, will make sure that the returned k elements are themselves sorted A tuple of (values, indices) is returned, where the indices are the indices of the elements in the original input tensor.
Returns the log of summed exponentials of each row of the input tensor in the given dimension dim. The computation is numerically stabilized.
Returns the upper triangular part of a matrix (2-D tensor) or batch of matrices input, the other elements of the result tensor out are set to 0. The upper triangular part of the matrix is defined as the elements on and above the diagonal. The argument diagonal controls which diagonal to consider. If diagonal = 0, all elements on and above the main diagonal are retained. A positive value excludes just as many diagonals above the main diagonal, and similarly a negative value includes just as many diagonals below the main diagonal. The main diagonal are the set of indices \((i,i)\) for \(i\) \(\in [0,\min(d_1,d_2)-1]\) where \(d_1\) and \(d_2 \) are the dimensions of the matrix.
Returns the lower triangular part of the matrix (2-D tensor) or batch of matrices input, the other elements of the result tensor out are set to 0. The lower triangular part of the matrix is defined as the elements on and below the diagonal. The argument diagonal controls which diagonal to consider. If diagonal = 0, all elements on and below the main diagonal are retained. A positive value includes just as many diagonals above the main diagonal, and similarly a negative value excludes just as many diagonals below the main diagonal. The main diagonals are the set of indices \((i,i)\) for \(i\) \(\in [0,\min(d_1,d_2)-1]\) where \(d_1\) and \(d_2 \) are the dimensions of the matrix.
Returns a new tensor with the truncated integer values of the elements of input.
:: Int | dim |
-> Bool | sorted |
-> Bool | return_inverse |
-> Bool | return_counts |
-> Tensor | input |
-> (Tensor, Tensor, Tensor) | output |
Returns the unique elements of the input tensor along a dimension.
Eliminates all but the first element from every consecutive group of equivalent elements. This function is different from uniqueDim in the sense that this function only eliminates consecutive duplicate values.
Eliminates all but the first element from every consecutive group of equivalent elements along a dimension. This function is different from uniqueDim in the sense that this function only eliminates consecutive duplicate values.
Returns a new tensor with a dimension of size one inserted at the specified position. The returned tensor shares the same underlying data with this tensor. A dim value within the range [(dim input) - 1, (dim input) + 1)] can be used. Negative dim will correspond to unsqueeze applied at dim = dim + (dim input) + 1
Upsamples the input, using bilinear upsampling. Expected inputs are spatial (4 dimensional).
Applies a 2D nearest neighbor upsampling to an input signal composed of several input channels.
Splits the tensor into chunks of given size if possible.
Creates a criterion that measures the mean absolute error (MAE) between each element in the input \(x\) and target \(y\) .
Applies the element-wise function: \(\text{LeakyReLU}(x) = \max(0,x) + \text{negative_slope} ∗ \min(0,x)\)
Applies the element-wise function: \(\text{LogSigmoid}(x) = \log(\frac{ 1 }{ 1 + \exp(-x)})\)
Returns a namedtuple (values, indices) where values is the maximum value of each row of the input tensor in the given dimension dim. And indices is the index location of each maximum value found (argmax). If keepdim is True, the output tensors are of the same size as input except in the dimension dim where they are of size 1. Otherwise, dim is squeezed , resulting in the output tensors having 1 fewer dimension than input.
Returns a namedtuple (values, indices) where values is the minimum value of each row of the input tensor in the given dimension dim. And indices is the index location of each minimum value found (argmin). If keepdim is True, the output tensors are of the same size as input except in the dimension dim where they are of size 1. Otherwise, dim is squeezed, resulting in the output tensors having 1 fewer dimension than input.
Returns the mean value of each row of the input tensor in the given dimension dim. If dim is a list of dimensions, reduce over all of them. If keepdim is True, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed (see torch.squeeze()), resulting in the output tensor having 1 (or len(dim)) fewer dimension(s).
Returns a namedtuple (values, indices) where values is the median value of each row of the input tensor in the given dimension dim. And indices is the index location of each median value found. By default, dim is the last dimension of the input tensor. If keepdim is True, the output tensors are of the same size as input except in the dimension dim where they are of size 1. Otherwise, dim is squeezed (see torch.squeeze()), resulting in the outputs tensor having 1 fewer dimension than input.
Returns the matrix product of the NN 2-D tensors. This product is efficiently computed using the matrix chain order algorithm which selects the order in which incurs the lowest cost in terms of arithmetic operations. Note that since this is a function to compute the product, NN needs to be greater than or equal to 2; if equal to 2 then a trivial matrix-matrix product is returned. If NN is 1, then this is a no-op - the original matrix is returned as is.
Applies element-wise the function \(\text{GELU}(x) = x * \Phi(x)\) where \(\Phi(x)\) is the Cumulative Distribution Function for Gaussian Distribution.
The gated linear unit. Computes: \(\text{GLU}(a, b) = a \otimes \sigma(b)\) where input is split in half along dim to form a and b, \(\sigma\) is the sigmoid function and \(\otimes\) is the element-wise product between matrices.
Returns the standard-deviation and mean of all elements in the input tensor. If unbiased is False, then the standard-deviation will be calculated via the biased estimator. Otherwise, Bessel’s correction will be used.
:: Dim | dimension |
-> Bool | unbiased |
-> KeepDim | whether the output tensor has dim retained or not |
-> Tensor | input |
-> (Tensor, Tensor) | output |
Returns the standard-deviation and mean of each row of the input tensor in the dimension dim. If dim is a list of dimensions, reduce over all of them. If keepdim is True, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed, resulting in the output tensor having 1 (or len(dim)) fewer dimension(s). If unbiased is False, then the standard-deviation will be calculated via the biased estimator. Otherwise, Bessel’s correction will be used.
Returns a copy of input. Output tensor keeps a computational graph and a requires_grad value of input tensor. https://discuss.pytorch.org/t/clone-and-detach-in-v0-4-0/16861/41
Returns a copy of input. Output tensor does not keep a computational graph and a requires_grad value of input tensor.
Returns a new tensor with the same data as the input tensor but of a different shape.
Repeats this tensor along the specified dimensions.
:: Tensor | weight |
-> Tensor | bias |
-> MutableTensor | running_mean |
-> MutableTensor | running_var |
-> Bool | training |
-> Double | momentum |
-> Double | eps |
-> Tensor | input |
-> IO Tensor | output |
:: Tensor | weight |
-> Tensor | bias |
-> MutableTensor | running_mean |
-> MutableTensor | running_var |
-> Bool | training |
-> Double | momentum |
-> Double | eps |
-> Tensor | input |
-> IO Tensor | output |