private TensorType resultType(TensorType argumentType) {
        List<String> peekDimensions;
        if (subspaceAddress.size() == 1 && subspaceAddress.get(0).dimension().isEmpty()) {
            // Special case where a single indexed or mapped dimension is sliced
            if (subspaceAddress.get(0).index().isPresent()) {
                peekDimensions = findDimensions(argumentType.dimensions(), TensorType.Dimension::isIndexed);
                if (peekDimensions.size() > 1) {
                    throw new IllegalArgumentException(this + " slices a single indexed dimension, cannot be applied " +
                                                       "to " + argumentType + ", which has multiple");
                }
            }
            else {
                peekDimensions = findDimensions(argumentType.dimensions(), TensorType.Dimension::isMapped);
                if (peekDimensions.size() > 1)
                    throw new IllegalArgumentException(this + " slices a single mapped dimension, cannot be applied " +
                                                       "to " + argumentType + ", which has multiple");
            }
        }
        else { // general slicing
            peekDimensions = subspaceAddress.stream().map(d -> d.dimension().get()).toList();
        }
        try {
            return TypeResolver.peek(argumentType, peekDimensions);
        }
        catch (IllegalArgumentException e) {
            throw new IllegalArgumentException(this + " cannot slice type " + argumentType, e);
        }
    }
Returns the subset of the given address which is present in the subspace type
vespajlib/src/main/java/com/yahoo/tensor/functions/Slice.java