private static void readDirectTensorValue(TokenBuffer buffer, Tensor.Builder builder) {
        boolean hasIndexed = builder.type().dimensions().stream().anyMatch(TensorType.Dimension::isIndexed);
        boolean hasMapped = builder.type().dimensions().stream().anyMatch(TensorType.Dimension::isMapped);

        if (isArrayOfObjects(buffer))
            readTensorCells(buffer, builder);
        else if ( ! hasMapped)
            readTensorValues(buffer, builder);
        else if (hasIndexed)
            readTensorBlocks(buffer, builder);
        else
            readTensorCells(buffer, builder);
    }
Reads a tensor value directly at the root, where the format is decided by the tensor type.
document/src/main/java/com/yahoo/document/json/readers/TensorReader.java