private static void encodeAddressedBlocks(MixedTensor tensor, Cursor cursor, boolean hexForDensePart) {
        var mappedDimensions = tensor.type().dimensions().stream()
                .filter(TensorType.Dimension::isMapped)
                .toList();
        if (mappedDimensions.isEmpty()) {
            throw new IllegalArgumentException("Should be ensured by caller");
        }
        // Create tensor type for mapped dimensions subtype
        TensorType mappedSubType = new TensorType.Builder(mappedDimensions).build();
        TensorType denseSubType = tensor.type().indexedSubtype();
        for (var subspace : tensor.getInternalDenseSubspaces()) {
            Cursor block = cursor.addObject();
            encodeAddress(mappedSubType, subspace.sparseAddress, block.setObject("address"));
            encodeLabeledSubspace("values", subspace, denseSubType, block, hexForDensePart);
        }
    }
Serializes the given tensor type and value into a short-form JSON format.

@deprecated use #encode(#Tensor, boolean, boolean)
vespajlib/src/main/java/com/yahoo/tensor/serialization/JsonFormat.java