public void assignTensor(Optional<Tensor> tensor) {
        assignTypeFrom(tensor);
        this.serializedTensor = Optional.empty();
        this.tensor = tensor;
    }
Assigns the given tensor to this field value.

The tensor type is also set from the given tensor if it was not set before.
document/src/main/java/com/yahoo/document/datatypes/TensorFieldValue.java