private int[] mapIndexes(TensorType fromType, TensorType toType) {
        int[] toIndexes = new int[fromType.dimensions().size()];
        for (int i = 0; i < fromType.dimensions().size(); i++)
            toIndexes[i] = toType.indexOfDimension(fromType.dimensions().get(i).name()).orElse(Tensor.invalidIndex);
        return toIndexes;
    }
Returns the an array having one entry in order for each dimension of fromType
containing the index at which toType contains the same dimension name.
That is, if the returned array contains n at index i then
fromType.dimensions().get(i).name.equals(toType.dimensions().get(n).name())
If some dimension in fromType is not present in toType, the corresponding index will be -1
vespajlib/src/main/java/com/yahoo/tensor/functions/Concat.java