public abstract class DimensionType extends java.lang.Object implements java.io.Serializable, Representable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DUMMY_NAME
dummy name for dimensionTypes that have not define name
|
static java.lang.String |
OUT_OF_VOCAB
The reported string value for values out of the mapping for the dimension.
|
static int |
UNKNOWN_SHAPE
The reported shape when there is no explicit knowledge other than the underlying primitive type.
|
| Constructor and Description |
|---|
DimensionType() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getDimensionValue(ReadableTuple tuple,
int column)
|
java.lang.String |
getName()
Get the name of the DimensionType
|
int |
getShape()
Get the shape.
|
java.lang.String |
indexToString(long index)
Deprecated.
Use
getDimensionValue(ReadableTuple, int) instead |
void |
setDimensionValue(WriteableTuple target,
int column,
java.lang.Object dimensionValue)
Sets a dimension in a particular column of a target tuple.
|
long |
stringToIndex(java.lang.String string)
Deprecated.
Use
setDimensionValue(WriteableTuple, int, Object) instead |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRepresentationpublic static final int UNKNOWN_SHAPE
public static final java.lang.String DUMMY_NAME
public static final java.lang.String OUT_OF_VOCAB
public void setDimensionValue(WriteableTuple target, int column, java.lang.Object dimensionValue)
target - the destination where the dimension value should be set. Hint: This will often be a com.linkedin.feathr.common.TensorBuildercolumn - the column number of the target tuple to be setdimensionValue - the value of the dimensionjava.lang.RuntimeException - will be thrown if value is not valid for this dimensionpublic java.lang.Object getDimensionValue(ReadableTuple tuple, int column)
setDimensionValue(com.linkedin.feathr.common.tensor.WriteableTuple, int, java.lang.Object). Reads a dimension from a particular column of a tuple.tuple - the tuple from which to read. Hint: This will often be a TensorIteratorcolumn - the column to read from the tuplepublic int getShape()
public java.lang.String getName()
@Deprecated public java.lang.String indexToString(long index)
getDimensionValue(ReadableTuple, int) insteadindex - the numeric index. 0 is reserved for out-of-vocab.@Deprecated public long stringToIndex(java.lang.String string)
setDimensionValue(WriteableTuple, int, Object) insteadstring - the string representation