@Override
    public IndexedTensor withType(TensorType type) {
        throwOnIncompatibleType(type);
        return new IndexedDoubleTensor(type, dimensionSizes(), values);
    }
Once we can store more cells than an int we should drop this method.
vespajlib/src/main/java/com/yahoo/tensor/IndexedDoubleTensor.java