public interface Tensor<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
Tensor.FlattenedView<T> |
Modifier and Type | Field and Description |
---|---|
static int[] |
SCALAR_SHAPE |
static int[] |
SCALAR_STRIDE |
Modifier and Type | Method and Description |
---|---|
T[] |
asFlatArray() |
double[] |
asFlatDoubleArray() |
int[] |
asFlatIntegerArray() |
default java.util.List<T> |
asFlatList() |
Tensor<T> |
duplicate() |
default BooleanTensor |
elementwiseEquals(Tensor that) |
static BooleanTensor |
elementwiseEquals(Tensor a,
Tensor b) |
Tensor.FlattenedView<T> |
getFlattenedView() |
long |
getLength() |
int |
getRank() |
int[] |
getShape() |
T |
getValue(int... index) |
default boolean |
hasSameShapeAs(int[] shape) |
default boolean |
hasSameShapeAs(Tensor that) |
default boolean |
isMatrix() |
default boolean |
isScalar() |
boolean |
isShapePlaceholder() |
default boolean |
isVector()
Returns true if the tensor is a vector.
|
static <T> Tensor<T> |
placeHolder(int[] shape) |
Tensor<T> |
reshape(int... newShape) |
T |
scalar() |
static <T> Tensor<T> |
scalar(T value) |
void |
setValue(T value,
int... index) |
Tensor<T> |
slice(int dimension,
int index) |
static final int[] SCALAR_SHAPE
static final int[] SCALAR_STRIDE
static BooleanTensor elementwiseEquals(Tensor a, Tensor b)
static <T> Tensor<T> scalar(T value)
static <T> Tensor<T> placeHolder(int[] shape)
int getRank()
int[] getShape()
long getLength()
boolean isShapePlaceholder()
T getValue(int... index)
void setValue(T value, int... index)
T scalar()
double[] asFlatDoubleArray()
int[] asFlatIntegerArray()
T[] asFlatArray()
Tensor.FlattenedView<T> getFlattenedView()
default java.util.List<T> asFlatList()
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(int[] shape)
default BooleanTensor elementwiseEquals(Tensor that)