public int indexOfDimensionAsInt(String dimension) {
        for (int i = 0; i < dimensions.size(); i++)
            if (dimensions.get(i).name().equals(dimension))
                return i;
        return Tensor.invalidIndex;
    }
Returns the 0-base index of this dimension, or empty if it is not present
vespajlib/src/main/java/com/yahoo/tensor/TensorType.java