default double asDouble() {
        if (!type().dimensions().isEmpty())
            throw new IllegalStateException("Require a dimensionless tensor but has " + type());
        if (size() == 0) return Double.NaN;
        return valueIterator().next();
    }
Returns the value of this as a double if it has no dimensions and one value

@throws IllegalStateException if this does not have zero dimensions and one value
vespajlib/src/main/java/com/yahoo/tensor/Tensor.java