docs: private void repmatIncrement(TensorBase other, double multiplier) {
      // Maps a key of other into a partial key of this.
      int[] dimensionMapping = getDimensionMapping(other.getDimensionNumbers());
      int[] partialKey = ArrayUtils.copyOf(getDimensionSizes(), getDimensionSizes().length);
      for (int i = 0; i < dimensionMapping.length; i++) {
        partialKey[dimensionMapping[i]] = 1;
      }
  
      int numValues = 1;
      for (int i = 0; i < partialKey.length; i++) {
        numValues *= partialKey[i];
      }
      int[] keyOffsets = new int[numValues];
      Iterator<int[]> myKeyIterator = new IntegerArrayIterator(partialKey, new int[0]);
      int ind = 0;
      while (myKeyIterator.hasNext()) {
        keyOffsets[ind] = dimKeyToIndex(myKeyIterator.next());
        ind++;
      }
      Preconditions.checkState(ind == keyOffsets.length);
  
      Iterator<KeyValue> otherKeyValues = other.keyValueIterator();
      while (otherKeyValues.hasNext()) {
        KeyValue otherKeyValue = otherKeyValues.next();
        int baseOffset = 0;
        for (int i = 0; i < otherKeyValue.getKey().length; i++) {
          baseOffset += otherKeyValue.getKey()[i] * indexOffsets[dimensionMapping[i]];
        }
  
        for (int i = 0; i < keyOffsets.length; i++) {
          values[baseOffset + keyOffsets[i]] += otherKeyValue.getValue() * multiplier;
        }
      }
    }