LinearOpsTensorAlgebra

interface LinearOpsTensorAlgebra<T> : TensorPartialDivisionAlgebra<T>

Common linear algebra operations. Operates on Tensor.

Parameters

T

the type of items closed under division in the tensors.

Functions

add
Link copied to clipboard
open override fun add(left: Tensor<T>, right: Tensor<T>): Tensor<T>
argMax
Link copied to clipboard
abstract fun Tensor<T>.argMax(dim: Int, keepDim: Boolean): Tensor<T>
Returns the index of maximum value of each row of the input tensor in the given dimension dim.
binaryOperation
Link copied to clipboard
open fun binaryOperation(operation: String, left: Tensor<T>, right: Tensor<T>): Tensor<T>
binaryOperationFunction
Link copied to clipboard
open override fun binaryOperationFunction(operation: String): (Tensor<T>, Tensor<T>) -> Tensor<T>
bindSymbol
Link copied to clipboard
open fun bindSymbol(value: String): Tensor<T>
bindSymbolOrNull
Link copied to clipboard
open fun bindSymbolOrNull(value: String): Tensor<T>?
cholesky
Link copied to clipboard
abstract fun Tensor<T>.cholesky(): Tensor<T>
Cholesky decomposition.
det
Link copied to clipboard
abstract fun Tensor<T>.det(): Tensor<T>
Computes the determinant of a square matrix input, or of each square matrix in a batched input.
diagonalEmbedding
Link copied to clipboard
abstract fun diagonalEmbedding(diagonalEntries: Tensor<T>, offset: Int = 0, dim1: Int = -2, dim2: Int = -1): Tensor<T>
Creates a tensor whose diagonals of certain 2D planes (specified by dim1 and dim2) are filled by diagonalEntries.
div
Link copied to clipboard
abstract operator fun T.div(other: Tensor<T>): Tensor<T>
Each element of the tensor other is divided by this value.
abstract operator fun Tensor<T>.div(value: T): Tensor<T>
Divide by the scalar value each element of this tensor returns a new resulting tensor.
abstract operator fun Tensor<T>.div(other: Tensor<T>): Tensor<T>
Each element of the tensor other is divided by each element of this tensor.
divAssign
Link copied to clipboard
abstract operator fun Tensor<T>.divAssign(value: T)
Divides by the scalar value each element of this tensor.
abstract operator fun Tensor<T>.divAssign(other: Tensor<T>)
Each element of this tensor is divided by each element of the other tensor.
dot
Link copied to clipboard
abstract infix fun Tensor<T>.dot(other: Tensor<T>): Tensor<T>
Matrix product of two tensors.
get
Link copied to clipboard
abstract operator fun Tensor<T>.get(i: Int): Tensor<T>
Returns the tensor at index i For more information: https://pytorch.org/cppdocs/notes/tensor_indexing.
inv
Link copied to clipboard
abstract fun Tensor<T>.inv(): Tensor<T>
Computes the multiplicative inverse matrix of a square matrix input, or of each square matrix in a batched input.
lu
Link copied to clipboard
abstract fun Tensor<T>.lu(): Triple<Tensor<T>, Tensor<T>, Tensor<T>>
LUP decompositionComputes the LUP decomposition of a matrix or a batch of matrices.
max
Link copied to clipboard
abstract fun Tensor<T>.max(): T
Returns the maximum value of all elements in the input tensor.
abstract fun Tensor<T>.max(dim: Int, keepDim: Boolean): Tensor<T>
Returns the maximum value of each row of the input tensor in the given dimension dim.
min
Link copied to clipboard
abstract fun Tensor<T>.min(): T
abstract fun Tensor<T>.min(dim: Int, keepDim: Boolean): Tensor<T>
Returns the minimum value of each row of the input tensor in the given dimension dim.
minus
Link copied to clipboard
abstract operator fun T.minus(other: Tensor<T>): Tensor<T>
Each element of the tensor other is subtracted from this value.
abstract operator fun Tensor<T>.minus(value: T): Tensor<T>
Subtracts the scalar value from each element of this tensor and returns a new resulting tensor.
abstract operator override fun Tensor<T>.minus(other: Tensor<T>): Tensor<T>
Each element of the tensor other is subtracted from each element of this tensor.
minusAssign
Link copied to clipboard
abstract operator fun Tensor<T>.minusAssign(value: T)
Subtracts the scalar value from each element of this tensor.
abstract operator fun Tensor<T>.minusAssign(other: Tensor<T>)
Each element of the tensor other is subtracted from each element of this tensor.
multiply
Link copied to clipboard
open override fun multiply(left: Tensor<T>, right: Tensor<T>): Tensor<T>
plus
Link copied to clipboard
abstract operator fun T.plus(other: Tensor<T>): Tensor<T>
Each element of the tensor other is added to this value.
abstract operator fun Tensor<T>.plus(value: T): Tensor<T>
Adds the scalar value to each element of this tensor and returns a new resulting tensor.
abstract operator override fun Tensor<T>.plus(other: Tensor<T>): Tensor<T>
Each element of the tensor other is added to each element of this tensor.
plusAssign
Link copied to clipboard
abstract operator fun Tensor<T>.plusAssign(value: T)
Adds the scalar value to each element of this tensor.
abstract operator fun Tensor<T>.plusAssign(other: Tensor<T>)
Each element of the tensor other is added to each element of this tensor.
qr
Link copied to clipboard
abstract fun Tensor<T>.qr(): Pair<Tensor<T>, Tensor<T>>
QR decomposition.
sum
Link copied to clipboard
abstract fun Tensor<T>.sum(): T
abstract fun Tensor<T>.sum(dim: Int, keepDim: Boolean): Tensor<T>
Returns the sum of each row of the input tensor in the given dimension dim.
svd
Link copied to clipboard
abstract fun Tensor<T>.svd(): Triple<Tensor<T>, Tensor<T>, Tensor<T>>
Singular Value Decomposition.
symEig
Link copied to clipboard
abstract fun Tensor<T>.symEig(): Pair<Tensor<T>, Tensor<T>>
Returns eigenvalues and eigenvectors of a real symmetric matrix input or a batch of real symmetric matrices, represented by a pair eigenvalues to eigenvectors.
times
Link copied to clipboard
abstract operator fun T.times(other: Tensor<T>): Tensor<T>
Each element of the tensor other is multiplied by this value.
abstract operator fun Tensor<T>.times(value: T): Tensor<T>
Multiplies the scalar value by each element of this tensor and returns a new resulting tensor.
abstract operator override fun Tensor<T>.times(other: Tensor<T>): Tensor<T>
Each element of the tensor other is multiplied by each element of this tensor.
timesAssign
Link copied to clipboard
abstract operator fun Tensor<T>.timesAssign(value: T)
Multiplies the scalar value by each element of this tensor.
abstract operator fun Tensor<T>.timesAssign(other: Tensor<T>)
Each element of the tensor other is multiplied by each element of this tensor.
transpose
Link copied to clipboard
abstract fun Tensor<T>.transpose(i: Int = -2, j: Int = -1): Tensor<T>
Returns a tensor that is a transposed version of this tensor.
unaryMinus
Link copied to clipboard
abstract operator override fun Tensor<T>.unaryMinus(): Tensor<T>
Numerical negative, element-wise.
unaryOperation
Link copied to clipboard
open fun unaryOperation(operation: String, arg: Tensor<T>): Tensor<T>
unaryOperationFunction
Link copied to clipboard
open override fun unaryOperationFunction(operation: String): (Tensor<T>) -> Tensor<T>
unaryPlus
Link copied to clipboard
open operator fun Tensor<T>.unaryPlus(): Tensor<T>
value
Link copied to clipboard
open fun Tensor<T>.value(): T
Returns a single tensor value of unit dimension.
valueOrNull
Link copied to clipboard
abstract fun Tensor<T>.valueOrNull(): T?
Returns a single tensor value of unit dimension if tensor shape equals to 1.
view
Link copied to clipboard
abstract fun Tensor<T>.view(shape: IntArray): Tensor<T>
Returns a new tensor with the same data as the self tensor but of a different shape.
viewAs
Link copied to clipboard
abstract fun Tensor<T>.viewAs(other: Tensor<T>): Tensor<T>
View this tensor as the same size as other.

Inheritors

DoubleTensorAlgebra
Link copied to clipboard

Sources

common source
Link copied to clipboard