static void indexedBlockToString(IndexedTensor tensor, Indexes indexes, long maxCells, StringBuilder b) {
        int index = 0;
        for (; index < tensor.size() && index < maxCells; index++) {
            indexes.next();
            if (index > 0)
                b.append(", ");

            // start brackets
            b.append("[".repeat(Math.max(0, indexes.nextDimensionsAtStart())));

            // value
            switch (tensor.type().valueType()) {
                case DOUBLE:   b.append(tensor.get(index)); break;
                case FLOAT:    b.append(tensor.getFloat(index)); break;
                case BFLOAT16: b.append(tensor.getFloat(index)); break;
                case INT8:     b.append((byte)tensor.getFloat(index)); break;
                default:
                    throw new IllegalStateException("Unexpected value type " + tensor.type().valueType());
            }

            // end bracket and comma
            b.append("]".repeat(Math.max(0, indexes.nextDimensionsAtEnd())));
        }
        if (index == maxCells && index < tensor.size())
            b.append(", ...]");
    }
Returns the value at the given <i>standard value order</i> index as a float.

@param valueIndex the direct index into the underlying data.
@throws IllegalArgumentException if index is out of bounds
vespajlib/src/main/java/com/yahoo/tensor/IndexedTensor.java