public final class TensorType
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static TensorType |
EMPTY |
| Constructor and Description |
|---|
TensorType(TensorCategory tensorCategory,
ValueType valueType,
java.util.List<DimensionType> dimensionTypes) |
TensorType(TensorCategory tensorCategory,
ValueType valueType,
java.util.List<DimensionType> dimensionTypes,
java.util.List<java.lang.String> dimensionNames) |
TensorType(ValueType valueType,
java.util.List<DimensionType> dimensionTypes)
Create a SPARSE tensor type with default local names for dimensions.
|
TensorType(ValueType valueType,
java.util.List<DimensionType> dimensionTypes,
java.util.List<java.lang.String> dimensionNames)
Create a SPARSE tensor type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
Representable[] |
getColumnTypes()
WARNING: this returns primitive representations, not DimensionType/ValueType.
|
int |
getDenseSize() |
java.util.List<java.lang.String> |
getDimensionNames() |
java.util.List<DimensionType> |
getDimensionTypes() |
int[] |
getShape() |
TensorCategory |
getTensorCategory() |
ValueType |
getValueType() |
int |
hashCode() |
void |
setDimensions(WriteableTuple target,
java.lang.Object[] dimensions) |
java.lang.String |
toString() |
public static final TensorType EMPTY
public TensorType(ValueType valueType, java.util.List<DimensionType> dimensionTypes)
valueType - the type of the value contained in the tensor.dimensionTypes - a sequence of types for all dimensions of the tensor (can be empty).
Dimension names will default to names taken from dimensionTypes.public TensorType(ValueType valueType, java.util.List<DimensionType> dimensionTypes, java.util.List<java.lang.String> dimensionNames)
valueType - the type of the value contained in the tensor.dimensionTypes - a sequence of types for all dimensions of the tensor (can be empty).dimensionNames - are local to the TensorType,
allowing to differentiate between multiple instances of the same dimension type,
for example, x used for both viewer and viewee.
If null, defaults to names taken from dimensionTypes.public TensorType(TensorCategory tensorCategory, ValueType valueType, java.util.List<DimensionType> dimensionTypes, java.util.List<java.lang.String> dimensionNames)
tensorCategory - the category of the tensor type, such as dense, sparse, etc.
NOTE: at the moment this is stored as is, and no additional validation is guaranteed
(such as choosing the right tensor builder based on the tensor category).valueType - the type of the value contained in the tensor.dimensionTypes - a sequence of types for all dimensions of the tensor (can be empty).dimensionNames - are local to the TensorType,
allowing to differentiate between multiple instances of the same dimension type,
for example, x used for both viewer and viewee.
If null, defaults to names taken from dimensionTypes.public TensorType(TensorCategory tensorCategory, ValueType valueType, java.util.List<DimensionType> dimensionTypes)
tensorCategory - the category of the tensor type, such as dense, sparse, etc.
NOTE: at the moment this is stored as is, and no additional validation is guaranteed
(such as choosing the right tensor builder based on the tensor category).valueType - the type of the value contained in the tensor.dimensionTypes - a sequence of types for all dimensions of the tensor (can be empty).public TensorCategory getTensorCategory()
public ValueType getValueType()
public java.util.List<DimensionType> getDimensionTypes()
public java.util.List<java.lang.String> getDimensionNames()
public Representable[] getColumnTypes()
public void setDimensions(WriteableTuple target, java.lang.Object[] dimensions)
public int[] getShape()
public int getDenseSize()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object