private Meta analyze(TensorType inputType) {
        if (inputType.valueType() != TensorType.Value.INT8) {
            throw new IllegalArgumentException("bad " + operationName + "; input must have cell-type int8, but it was: " + inputType.valueType());
        }
        TensorType inputDenseType = inputType.indexedSubtype();
        if (inputDenseType.rank() == 0) {
            throw new IllegalArgumentException("bad " + operationName + "; input must have indexed dimension, but type was: " + inputType);
        }
        var lastDim = inputDenseType.dimensions().get(inputDenseType.rank() - 1);
        if (lastDim.size().isEmpty()) {
            throw new IllegalArgumentException("bad " + operationName + "; last indexed dimension must be bound, but type was: " + inputType);
        }
        var ttBuilder = new TensorType.Builder(targetCellType);
        for (var dim : inputType.dimensions()) {
            if (dim.name().equals(lastDim.name())) {
                long sz = dim.size().get();
                ttBuilder.indexed(dim.name(), sz * 8);
            } else {
                ttBuilder.set(dim);
            }
        }
        TensorType outputType = ttBuilder.build();
        return new Meta(outputType, outputType.indexedSubtype(), lastDim.name());
    }
Macro that expands to the appropriate map_subspaces magic incantation

@author arnej
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/UnpackBitsNode.java