public TensorAddress asAddress(TensorType type) {
        if (type.rank() != size())
            throw new IllegalArgumentException(type + " has a different rank than " + this);
        Label[] labels = new Label[this.labels.length];
        for (int i = 0; i < type.dimensions().size(); i++) {
            Label label = objectLabel(type.dimensions().get(i).name());
            if (label.isEqualTo(LabelCache.INVALID_INDEX_LABEL))
                throw new IllegalArgumentException(type + " dimension names does not match " + this);
            labels[i] = label;
        }
        return TensorAddressAny.ofUnsafe(labels);
    }
Returns this as an address in the given tensor type
vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java