static private Function<Float,Float> selectRestrict(TensorType.Value toValueType) {
        return switch (toValueType) {
            case BFLOAT16 -> val -> Float.intBitsToFloat(Float.floatToRawIntBits(val) & ~0xffff);
            case INT8 -> val -> (float) val.byteValue();
            default -> val -> val;
        };
    }
The <i>cell_cast</i> tensor function creates a new tensor with the specified cell value type.

@author lesters
vespajlib/src/main/java/com/yahoo/tensor/functions/CellCast.java