Tensor

public class Tensor

Represents real, multidimensional tensor. Length of a data must fit the shape.

Parameters

shape

tensor shape.

data

must fit into the shape of this tensor.

Constructors

Tensor
Link copied to clipboard
Tensor Tensor(IntArray shape, LongArray data)
data can be LongArray.
Tensor
Link copied to clipboard
Tensor Tensor(IntArray shape, FloatArray data)
data can be FloatArray.
Tensor
Link copied to clipboard
Tensor Tensor(IntArray shape, IntArray data)
data can be IntArray.
Tensor
Link copied to clipboard
Tensor Tensor(IntArray shape, DoubleArray data)
makes a new tensor with a given shape and data.

Types

Companion
Link copied to clipboard
public class Companion

Functions

concat
Link copied to clipboard
final Tensor concat(Tensor other, Integer concatDim)
Concatenate to other tensor.
copy
Link copied to clipboard
Tensor copy()
Make a new copy of this tensor.
div
Link copied to clipboard
Tensor div(Number other)
equals
Link copied to clipboard
Boolean equals(Object other)
flatten
Link copied to clipboard
final Tensor flatten()
Reshape to a 1-dimensional tensor.
frobeniusNormSquared
Link copied to clipboard
final Double frobeniusNormSquared()
Calculate squared frobenius norm.
get
Link copied to clipboard
final Double get(IntArray indices)
final Tensor get(Long indexLong)
getDim
Link copied to clipboard
final Integer getDim()
tensor dimension.
getShape
Link copied to clipboard
final IntArray getShape()
tensor shape.
map
Link copied to clipboard
Tensor map(Function1<Double, Number> lambda)
Apply a mapping function to each element.
minus
Link copied to clipboard
final Tensor minus(Tensor other)
plus
Link copied to clipboard
final Tensor plus(Tensor other)
pseudoEquals
Link copied to clipboard
final Boolean pseudoEquals(Tensor other)
Determines if other is close enough to be said the same.
reshape
Link copied to clipboard
final Tensor reshape(IntArray newShape)
Reshape this tensor.
set
Link copied to clipboard
final Unit set(IntArray indices, Number value)
times
Link copied to clipboard
Tensor times(Number other)
final Tensor times(Tensor other)
toComplex
Link copied to clipboard
ComplexTensor toComplex()
Convert to ComplexTensor.
toMatrix
Link copied to clipboard
final Matrix toMatrix()
Downcast to Matrix class, if possible: i.e.
toString
Link copied to clipboard
String toString()
unaryMinus
Link copied to clipboard
Tensor unaryMinus()
unaryPlus
Link copied to clipboard
Tensor unaryPlus()

Properties

dim
Link copied to clipboard
private final Integer dim
tensor dimension.
shape
Link copied to clipboard
private final IntArray shape
tensor shape.

Inheritors

Matrix
Link copied to clipboard

Extensions

convCheck
Link copied to clipboard
public final Double convCheck
equalityValidation
Link copied to clipboard
public final Double equalityValidation
pseudoEquals
Link copied to clipboard
final Boolean pseudoEquals(Double x, Double y)