public interface Tensor<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
Tensor.FlattenedView<T> |
Modifier and Type | Field and Description |
---|---|
static long[] |
ONE_BY_ONE_SHAPE |
static long[] |
SCALAR_SHAPE |
static long[] |
SCALAR_STRIDE |
Modifier and Type | Method and Description |
---|---|
T[] |
asFlatArray() |
double[] |
asFlatDoubleArray() |
int[] |
asFlatIntegerArray() |
default java.util.List<T> |
asFlatList() |
static <DATA,TENSOR extends Tensor<DATA>> |
create(DATA[] data,
long[] shape) |
static <DATA,TENSOR extends Tensor<DATA>> |
createFilled(DATA data,
long[] shape) |
Tensor<T> |
duplicate() |
BooleanTensor |
elementwiseEquals(T value) |
default BooleanTensor |
elementwiseEquals(Tensor that) |
static BooleanTensor |
elementwiseEquals(Tensor a,
Tensor b) |
Tensor.FlattenedView<T> |
getFlattenedView() |
long |
getLength() |
int |
getRank() |
long[] |
getShape() |
default T |
getValue(int... index) |
T |
getValue(long... index) |
default boolean |
hasSameShapeAs(long[] shape) |
default boolean |
hasSameShapeAs(Tensor that) |
default boolean |
isLengthOne() |
default boolean |
isMatrix() |
default boolean |
isScalar() |
boolean |
isShapePlaceholder() |
default boolean |
isVector()
Returns true if the tensor is a vector.
|
Tensor<T> |
reshape(long... newShape) |
T |
scalar() |
static <DATA,TENSOR extends Tensor<DATA>> |
scalar(DATA data) |
Tensor<T> |
setValue(T value,
long... index) |
Tensor<T> |
slice(int dimension,
long index) |
static final long[] SCALAR_SHAPE
static final long[] SCALAR_STRIDE
static final long[] ONE_BY_ONE_SHAPE
static <DATA,TENSOR extends Tensor<DATA>> TENSOR scalar(DATA data)
static <DATA,TENSOR extends Tensor<DATA>> TENSOR createFilled(DATA data, long[] shape)
static <DATA,TENSOR extends Tensor<DATA>> TENSOR create(DATA[] data, long[] shape)
static BooleanTensor elementwiseEquals(Tensor a, Tensor b)
int getRank()
long[] getShape()
long getLength()
boolean isShapePlaceholder()
T getValue(long... index)
default T getValue(int... index)
T scalar()
double[] asFlatDoubleArray()
int[] asFlatIntegerArray()
T[] asFlatArray()
Tensor.FlattenedView<T> getFlattenedView()
default java.util.List<T> asFlatList()
default boolean isLengthOne()
default boolean isScalar()
default boolean isVector()
(1, 2, 3) is a 1x3 vector.
(1) (2) (3) is a 3x1 vector.
default boolean isMatrix()
default boolean hasSameShapeAs(Tensor that)
default boolean hasSameShapeAs(long[] shape)
default BooleanTensor elementwiseEquals(Tensor that)
BooleanTensor elementwiseEquals(T value)