Package com.yahoo.document.datatypes
Class TensorFieldValue
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.document.datatypes.FieldValue
com.yahoo.document.datatypes.TensorFieldValue
- All Implemented Interfaces:
Cloneable,Comparable<FieldValue>
Field value class that wraps a tensor.
- Author:
- geirst
-
Field Summary
Fields inherited from class com.yahoo.document.datatypes.FieldValue
classId -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty tensor field value where the tensor type is not yet known.TensorFieldValue(com.yahoo.tensor.Tensor tensor) Create a tensor field value containing the given tensorTensorFieldValue(com.yahoo.tensor.TensorType type) Create an empty tensor field value for the given tensor type -
Method Summary
Modifier and TypeMethodDescriptionvoidAssign this non-fieldvalue value to this field value.voidassignSerializedTensor(byte[] data) voidassignTensor(Optional<com.yahoo.tensor.Tensor> tensor) Assigns the given tensor to this field value.voidclear()voiddeserialize(Field field, FieldReader reader) Read a field value from the specified readerbooleanOptional<byte[]>Optional<com.yahoo.tensor.Tensor>Optional<com.yahoo.tensor.TensorType>Used to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values.voidDeprecated.voidserialize(Field field, FieldWriter writer) Write out field value to the specified writertoString()Methods inherited from class com.yahoo.document.datatypes.FieldValue
clone, compareTo, create, deserialize, getRecursiveValue, getRecursiveValue, onDeserialize, onSerialize, serialize, toXmlMethods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, hashCode, onGetClassId, putUtf8, registerClass, registerClass, serialize, serializeOptional, serializeWithId, visitMembersMethods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Constructor Details
-
TensorFieldValue
public TensorFieldValue()Create an empty tensor field value where the tensor type is not yet known. The tensor (and tensor type) can later be assigned with assignTensor(). -
TensorFieldValue
public TensorFieldValue(com.yahoo.tensor.TensorType type) Create an empty tensor field value for the given tensor type -
TensorFieldValue
public TensorFieldValue(com.yahoo.tensor.Tensor tensor) Create a tensor field value containing the given tensor
-
-
Method Details
-
getTensor
-
getTensorType
-
getDataType
- Specified by:
getDataTypein classFieldValue
-
toString
- Overrides:
toStringin classcom.yahoo.vespa.objects.Identifiable
-
printXml
Deprecated.- Specified by:
printXmlin classFieldValue
-
clear
public void clear()- Specified by:
clearin classFieldValue
-
assign
Description copied from class:FieldValueAssign this non-fieldvalue value to this field value. This is used to be able to assign ints to Integer field values and List to Array field values and such.Override to accept the specific types that should be legal.
- Specified by:
assignin classFieldValue
-
assignSerializedTensor
public void assignSerializedTensor(byte[] data) -
getSerializedTensor
-
assignTensor
Assigns the given tensor to this field value. The tensor type is also set from the given tensor if it was not set before. -
serialize
Description copied from class:FieldValueWrite out field value to the specified writer- Specified by:
serializein classFieldValue
-
deserialize
Description copied from class:FieldValueRead a field value from the specified reader- Specified by:
deserializein classFieldValue
-
equals
- Overrides:
equalsin classcom.yahoo.vespa.objects.Identifiable
-
getWrappedValue
Description copied from class:FieldValueUsed to retrieve wrapped type for simple types, such that you can use get methods to retrieve ints and floats directly instead of Int/Float field values. Complex types that can't be specified by simple java types just return themselves.- Overrides:
getWrappedValuein classFieldValue
-