Package-level declarations

Types

Link copied to clipboard

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

Link copied to clipboard
abstract class BufferedTensor<T>(val shape: ShapeND) : MutableStructureND<T>

Represents Tensor over a MutableBuffer intended to be used through DoubleTensor and IntTensor

Link copied to clipboard

Default BufferedTensor implementation for Double values.

Link copied to clipboard
Link copied to clipboard
class DoubleTensor2D(val rowNum: Int, val colNum: Int, val source: OffsetDoubleBuffer) : DoubleTensor, MutableStructure2D<Double>
Link copied to clipboard

Implementation of basic operations over double tensors and basic algebra operations on them.

Link copied to clipboard
class IntTensor(shape: ShapeND, val source: OffsetIntBuffer) : BufferedTensor<Int>

Default BufferedTensor implementation for Int values

Link copied to clipboard

Implementation of basic operations over double tensors and basic algebra operations on them.

Link copied to clipboard
class OffsetDoubleBuffer(val origin: DoubleBuffer, offset: Int, val size: Int) : MutableBuffer<Double> , BufferView<Double>
Link copied to clipboard
class OffsetIntBuffer(source: IntBuffer, offset: Int, val size: Int) : MutableBuffer<Int>

Default BufferedTensor implementation for Int values

Functions

Link copied to clipboard

Transforms StructureND of Double to DoubleTensor. Zero copy if possible, but is not guaranteed

Link copied to clipboard

A zero-copy cast to 1D structure. Changes in resulting structure are reflected on original tensor.

Link copied to clipboard

A zero-copy cast to 2D structure. Changes in resulting structure are reflected on original tensor.

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

QR decomposition.

Link copied to clipboard

Create a mutable copy of given StructureND.

Link copied to clipboard

Returns the covariance matrix M of given vectors.

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
inline fun DoubleTensor.forEachMatrix(block: (index: IntArray, matrix: DoubleTensor2D) -> Unit)
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

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 fun OffsetDoubleBuffer.map(operation: (Double) -> Double): DoubleBuffer
inline fun OffsetIntBuffer.map(operation: (Int) -> Int): IntBuffer

Map only operable content of the offset buffer

Link copied to clipboard
inline fun OffsetDoubleBuffer.mapInPlace(operation: (Double) -> Double)
inline fun OffsetIntBuffer.mapInPlace(operation: (Int) -> Int)

map in place

Link copied to clipboard
@JvmName(name = "varArgOne")
fun DoubleTensorAlgebra.one(vararg shape: Int): DoubleTensor
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

Concatenates a sequence of tensors with equal shapes along the first dimension.

Link copied to clipboard

Singular Value Decomposition.

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
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
inline fun OffsetDoubleBuffer.zip(other: OffsetDoubleBuffer, operation: (l: Double, r: Double) -> Double): DoubleBuffer
inline fun OffsetIntBuffer.zip(other: OffsetIntBuffer, operation: (l: Int, r: Int) -> Int): IntBuffer