BroadcastDoubleTensorAlgebra

Basic linear algebra operations implemented with broadcasting. For more information: https://pytorch.org/docs/stable/notes/broadcasting.html

Functions

Link copied to clipboard
open override fun acos(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun acosh(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun add(left: StructureND<Double>, right: StructureND<Double>): Tensor<Double>
Link copied to clipboard
open override fun StructureND<Double>.argMax(dim: Int, keepDim: Boolean): IntTensor

Returns the index of maximum value of each row of the input tensor in the given dimension dim.

Link copied to clipboard
open override fun StructureND<Double>.argMin(dim: Int, keepDim: Boolean): Tensor<Int>

Returns the index of minimum value of each row of the input tensor in the given dimension dim.

Link copied to clipboard
open override fun asin(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun asinh(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun atan(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun atanh(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
Link copied to clipboard
open override fun binaryOperationFunction(operation: String): (left: StructureND<Double>, right: StructureND<Double>) -> StructureND<Double>
Link copied to clipboard
open fun bindSymbol(value: String): StructureND<Double>
Link copied to clipboard
Link copied to clipboard
open override fun ceil(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun cholesky(structureND: StructureND<Double>): DoubleTensor

Cholesky decomposition.

Link copied to clipboard
fun DoubleTensorAlgebra.cholesky(structureND: StructureND<Double>, epsilon: Double = 1.0E-6): DoubleTensor

QR decomposition.

Link copied to clipboard
open override fun cos(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun cosh(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard

Returns the covariance matrix M of given vectors.

Link copied to clipboard
open override fun StructureND<Double>.det(): DoubleTensor

Computes the determinant of a square matrix input, or of each square matrix in a batched input. For more information: https://pytorch.org/docs/stable/linalg.html#torch.linalg.det

Link copied to clipboard
fun DoubleTensorAlgebra.detLU(structureND: StructureND<Double>, epsilon: Double = 1.0E-9): DoubleTensor

Computes the determinant of a square matrix input, or of each square matrix in a batched input using LU factorization algorithm.

Link copied to clipboard
open override fun diagonalEmbedding(diagonalEntries: StructureND<Double>, offset: Int, dim1: Int, dim2: Int): DoubleTensor

Creates a tensor whose diagonals of certain 2D planes (specified by dim1 and dim2) are filled by diagonalEntries. To facilitate creating batched diagonal matrices, the 2D planes formed by the last two dimensions of the returned tensor are chosen by default.

Link copied to clipboard
open operator fun StructureND<Double>.div(k: Number): StructureND<Double>

open operator override fun StructureND<Double>.div(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is divided by each element of this tensor. The resulting tensor is returned.

open operator override fun Double.div(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is divided by this value. The resulting tensor is returned.

open operator override fun StructureND<Double>.div(arg: Double): DoubleTensor

Divide by the scalar arg each element of this tensor returns a new resulting tensor.

Link copied to clipboard
open operator override fun Tensor<Double>.divAssign(arg: StructureND<Double>)

Each element of this tensor is divided by each element of the arg tensor.

open operator override fun Tensor<Double>.divAssign(value: Double)

Divides by the scalar value each element of this tensor.

Link copied to clipboard
open override fun divide(left: StructureND<Double>, right: StructureND<Double>): StructureND<Double>
Link copied to clipboard
open infix override fun StructureND<Double>.dot(other: StructureND<Double>): DoubleTensor

Matrix product of two tensors.

Link copied to clipboard
infix fun Tensor<Double>.eq(other: Tensor<Double>): Boolean

Compares element-wise two tensors. Comparison of two Double values occurs with 1e-5 precision.

fun Tensor<Double>.eq(other: Tensor<Double>, epsilon: Double): Boolean

Compares element-wise two tensors with a specified precision.

Link copied to clipboard
open override fun exp(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
Link copied to clipboard

Returns a 2D tensor with shape (n, n), with ones on the diagonal and zeros elsewhere.

Link copied to clipboard
open override fun floor(structureND: StructureND<Double>): DoubleTensor
Link copied to clipboard

Constructs a tensor with the specified shape and data.

Link copied to clipboard
Link copied to clipboard
fun full(value: Double, shape: ShapeND): DoubleTensor

Creates a tensor of a given shape and fills all elements with a given value.

Link copied to clipboard
fun fullLike(structureND: StructureND<*>, value: Double): DoubleTensor

Returns a tensor with the same shape as input filled with value.

Link copied to clipboard
open fun <F : StructureFeature> getFeature(structure: StructureND<Double>, type: KClass<out F>): F?
Link copied to clipboard
open fun Tensor<Double>.getTensor(first: Int, second: Int): Tensor<Double>

open override fun Tensor<Double>.getTensor(i: Int): DoubleTensor

Returns the tensor at index i For more information: https://pytorch.org/cppdocs/notes/tensor_indexing.html

Link copied to clipboard
open override fun StructureND<Double>.inv(): DoubleTensor

Computes the multiplicative inverse matrix of a square matrix input, or of each square matrix in a batched input. Given a square matrix A, return the matrix AInv satisfying A dot AInv == AInv dot A == eye(a.shape[0]). For more information: https://pytorch.org/docs/stable/linalg.html#torch.linalg.inv

Link copied to clipboard
fun DoubleTensorAlgebra.invLU(structureND: StructureND<Double>, epsilon: Double = 1.0E-9): DoubleTensor

Computes the multiplicative inverse matrix of a square matrix input, or of each square matrix in a batched input using LU factorization algorithm. Given a square matrix a, return the matrix aInv satisfying a dot aInv == aInv dot a == eye(a.shape[0]).

Link copied to clipboard
open operator fun (Double) -> Double.invoke(structure: StructureND<Double>): StructureND<Double>
Link copied to clipboard
open override fun ln(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun lu(structureND: StructureND<Double>): Triple<DoubleTensor, DoubleTensor, DoubleTensor>

LUP decomposition

Link copied to clipboard

LUP decomposition.

Link copied to clipboard

Computes the LU factorization of a matrix or batches of matrices input. Returns a tuple containing the LU factorization and pivots of input.

Link copied to clipboard

Unpacks the data and pivots from a LU factorization of a tensor. Given a tensor luTensor, return tensors Triple(P, L, U) satisfying P dot luTensor = L dot U, with P being a permutation matrix or batch of matrices, L being a lower triangular matrix or batch of matrices, U being an upper triangular matrix or batch of matrices.

Link copied to clipboard
inline override fun StructureND<Double>.map(transform: DoubleField.(Double) -> Double): DoubleTensor

Applies the transform function to each element of the tensor and returns the resulting modified tensor.

Link copied to clipboard
inline override fun StructureND<Double>.mapIndexed(transform: DoubleField.(index: IntArray, Double) -> Double): DoubleTensor
Link copied to clipboard
Link copied to clipboard
inline fun Tensor<Double>.mapInPlace(operation: (Double) -> Double)
Link copied to clipboard

Broadcasting Matrix product of two tensors.

Link copied to clipboard
open override fun StructureND<Double>.max(): Double

Returns the maximum value of all elements in the input tensor or null if there are no values

open override fun StructureND<Double>.max(dim: Int, keepDim: Boolean): DoubleTensor

Returns the maximum value of each row of the input tensor in the given dimension dim.

Link copied to clipboard
open override fun mean(structureND: StructureND<Double>): Double

open override fun mean(structureND: StructureND<Double>, dim: Int, keepDim: Boolean): Tensor<Double>

Returns the mean of each row of the input tensor in the given dimension dim.

Link copied to clipboard
open override fun StructureND<Double>.min(): Double

open override fun StructureND<Double>.min(dim: Int, keepDim: Boolean): DoubleTensor

Returns the minimum value of each row of the input tensor in the given dimension dim.

Link copied to clipboard
open operator override fun StructureND<Double>.minus(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is subtracted from each element of this tensor. The resulting tensor is returned.

open operator override fun Double.minus(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is subtracted from this value. The resulting tensor is returned.

open operator override fun StructureND<Double>.minus(arg: Double): DoubleTensor

Subtracts the scalar arg from each element of this tensor and returns a new resulting tensor.

Link copied to clipboard
open operator override fun Tensor<Double>.minusAssign(arg: StructureND<Double>)

Each element of the tensor arg is subtracted from each element of this tensor.

open operator override fun Tensor<Double>.minusAssign(value: Double)

Subtracts the scalar value from each element of this tensor.

Link copied to clipboard
open override fun multiply(left: StructureND<Double>, right: StructureND<Double>): Tensor<Double>
Link copied to clipboard
@JvmName(name = "varArgOne")
fun DoubleTensorAlgebra.one(vararg shape: Int): DoubleTensor
Link copied to clipboard

Returns a tensor filled with the scalar value 1.0, with the shape defined by the variable argument shape.

Link copied to clipboard
fun onesLike(structureND: StructureND<*>): DoubleTensor

Returns a tensor filled with the scalar value 1.0, with the same shape as a given array.

Link copied to clipboard
open operator override fun StructureND<Double>.plus(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is added to each element of this tensor. The resulting tensor is returned.

open operator override fun Double.plus(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is added to this value. The resulting tensor is returned.

open operator override fun StructureND<Double>.plus(arg: Double): DoubleTensor

Adds the scalar arg to each element of this tensor and returns a new resulting tensor.

Link copied to clipboard
open operator override fun Tensor<Double>.plusAssign(arg: StructureND<Double>)

Each element of the tensor arg is added to each element of this tensor.

open operator override fun Tensor<Double>.plusAssign(value: Double)

Adds the scalar value to each element of this tensor.

Link copied to clipboard
open infix fun StructureND<Double>.pow(pow: Number): StructureND<Double>
Link copied to clipboard
open override fun power(arg: StructureND<Double>, pow: Number): StructureND<Double>
Link copied to clipboard
open override fun qr(structureND: StructureND<Double>): Pair<DoubleTensor, DoubleTensor>

QR decomposition.

Link copied to clipboard

Returns a tensor of random numbers drawn from normal distributions with 0.0 mean and 1.0 standard deviation.

Link copied to clipboard

Returns a tensor with the same shape as input of random numbers drawn from normal distributions with 0.0 mean and 1.0 standard deviation.

Link copied to clipboard
Link copied to clipboard

Builds tensor from rows of the input tensor.

Link copied to clipboard
open override fun scale(a: StructureND<Double>, value: Double): StructureND<Double>
Link copied to clipboard
open override fun sin(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun sinh(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun sqrt(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun std(structureND: StructureND<Double>): Double

open override fun std(structureND: StructureND<Double>, dim: Int, keepDim: Boolean): Tensor<Double>

Returns the standard deviation of each row of the input tensor in the given dimension dim.

Link copied to clipboard
open override fun structureND(shape: ShapeND, initializer: DoubleField.(IntArray) -> Double): DoubleTensor

Constructs a tensor with the specified shape and initializer.

Link copied to clipboard
open override fun StructureND<Double>.sum(): Double

open override fun StructureND<Double>.sum(dim: Int, keepDim: Boolean): DoubleTensor

Returns the sum of each row of the input tensor in the given dimension dim.

Link copied to clipboard

Singular Value Decomposition.

Link copied to clipboard

Singular Value Decomposition.

Link copied to clipboard
open override fun symEig(structureND: StructureND<Double>): Pair<DoubleTensor, DoubleTensor>

Returns eigenvalues and eigenvectors of a real symmetric matrix input or a batch of real symmetric matrices, represented by a pair eigenvalues to eigenvectors. For more information: https://pytorch.org/docs/stable/generated/torch.symeig.html

Link copied to clipboard
Link copied to clipboard

Returns eigenvalues and eigenvectors of a real symmetric matrix input or a batch of real symmetric matrices, represented by a pair eigenvalues to eigenvectors.

Link copied to clipboard
open override fun tan(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open override fun tanh(arg: StructureND<Double>): DoubleTensor
Link copied to clipboard
open operator fun Number.times(arg: StructureND<Double>): StructureND<Double>
open operator fun StructureND<Double>.times(k: Number): StructureND<Double>

open operator override fun StructureND<Double>.times(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is multiplied by each element of this tensor. The resulting tensor is returned.

open operator override fun Double.times(arg: StructureND<Double>): DoubleTensor

Each element of the tensor arg is multiplied by this value. The resulting tensor is returned.

open operator override fun StructureND<Double>.times(arg: Double): DoubleTensor

Multiplies the scalar arg by each element of this tensor and returns a new resulting tensor.

Link copied to clipboard
open operator override fun Tensor<Double>.timesAssign(arg: StructureND<Double>)

Each element of the tensor arg is multiplied by each element of this tensor.

open operator override fun Tensor<Double>.timesAssign(value: Double)

Multiplies the scalar value by each element of this tensor.

Link copied to clipboard
open override fun StructureND<Double>.transposed(i: Int, j: Int): Tensor<Double>

Returns a tensor that is a transposed version of this tensor. The given dimensions i and j are swapped. For more information: https://pytorch.org/docs/stable/generated/torch.transpose.html

Link copied to clipboard
open operator override fun StructureND<Double>.unaryMinus(): DoubleTensor

Numerical negative, element-wise.

Link copied to clipboard
Link copied to clipboard
open override fun unaryOperationFunction(operation: String): (arg: StructureND<Double>) -> StructureND<Double>
Link copied to clipboard
Link copied to clipboard
open override fun StructureND<Double>.value(): Double

Returns a single tensor value of unit dimension. The tensor shape must be equal to 1.

Link copied to clipboard
open override fun StructureND<Double>.valueOrNull(): Double?

Returns a single tensor value of unit dimension if tensor shape equals to 1.

Link copied to clipboard
open override fun variance(structureND: StructureND<Double>): Double

open override fun variance(structureND: StructureND<Double>, dim: Int, keepDim: Boolean): Tensor<Double>

Returns the variance of each row of the input tensor in the given dimension dim.

Link copied to clipboard
open override fun Tensor<Double>.view(shape: ShapeND): DoubleTensor

Returns a new tensor with the same data as the self tensor but of a different shape. The returned tensor shares the same data and must have the same number of elements, but may have a different size For more information: https://pytorch.org/docs/stable/tensor_view.html

Link copied to clipboard
open override fun Tensor<Double>.viewAs(other: StructureND<Double>): DoubleTensor

View this tensor as the same size as other. this.viewAs(other) is equivalent to this.view(other.shape). For more information: https://pytorch.org/cppdocs/notes/tensor_indexing.html

Link copied to clipboard

Compute a value using broadcast double tensor algebra

Link copied to clipboard
@JvmName(name = "varArgZero")
fun DoubleTensorAlgebra.zero(vararg shape: Int): DoubleTensor
Link copied to clipboard
fun zeroesLike(structureND: StructureND<*>): DoubleTensor

Returns a tensor filled with the scalar value 0.0, with the same shape as a given array.

Link copied to clipboard

Returns a tensor filled with the scalar value 0.0, with the shape defined by the variable argument shape.

Link copied to clipboard
inline override fun zip(left: StructureND<Double>, right: StructureND<Double>, transform: DoubleField.(Double, Double) -> Double): DoubleTensor

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val elementAlgebra: DoubleField