Class PrimitiveDimensionType
java.lang.Object
com.linkedin.feathr.common.tensor.DimensionType
com.linkedin.feathr.common.tensor.PrimitiveDimensionType
- All Implemented Interfaces:
Representable,Serializable
The most basic type of a dimension.
Only specifies the primitive type and an optional shape ("size"), without any high-level metadata.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PrimitiveDimensionTypestatic final PrimitiveDimensionTypestatic final PrimitiveDimensionTypestatic final PrimitiveDimensionTypestatic final PrimitiveDimensionTypeFields inherited from class com.linkedin.feathr.common.tensor.DimensionType
DUMMY_NAME, OUT_OF_VOCAB, UNKNOWN_SHAPE -
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveDimensionType(Primitive primitive) PrimitiveDimensionType(Primitive primitive, int shape) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()Get the name of the DimensionTypeintgetShape()Get the shape.inthashCode()voidsetDimensionValue(WriteableTuple target, int column, Object dimensionValue) Sets a dimension in a particular column of a target tuple.toString()withShape(int shape) Methods inherited from class com.linkedin.feathr.common.tensor.DimensionType
getDimensionValue, indexToString, stringToIndex
-
Field Details
-
LONG
-
INT
-
STRING
-
BOOLEAN
-
BYTES
-
-
Constructor Details
-
PrimitiveDimensionType
-
PrimitiveDimensionType
-
-
Method Details
-
withShape
- Parameters:
shape- the shape of the new type.- Returns:
- a copy of this type with a new shape.
-
getShape
public int getShape()Description copied from class:DimensionTypeGet the shape.- Overrides:
getShapein classDimensionType- Returns:
- the shape - the number of maximum possible unique values in this dimension. Can be UNKNOWN_SHAPE.
-
getRepresentation
-
getName
Description copied from class:DimensionTypeGet the name of the DimensionType- Overrides:
getNamein classDimensionType- Returns:
- the name
-
equals
-
hashCode
public int hashCode() -
setDimensionValue
Description copied from class:DimensionTypeSets a dimension in a particular column of a target tuple. For primitive dimensions, implementations will just copy the value over. (This is the default behavior.) For high-level semantic dimensions that maintain a different set of "outward-facing" and "internal" representations of the dimension values, implementations will apply any necessary translation on the input dimensionValue before inserting into the tuple.- Overrides:
setDimensionValuein classDimensionType- Parameters:
target- the destination where the dimension value should be set. Hint: This will often be acom.linkedin.feathr.common.TensorBuildercolumn- the column number of the target tuple to be setdimensionValue- the value of the dimension
-
toString
-