docs: protected static final SparseTensor elementwiseMultiplyLeftAligned(SparseTensor big, Tensor small) {
      // The result tensor is no larger than the larger (superset of
      // dimensions) tensor.
      long[] resultKeyInts = new long[big.size()];
      double[] resultValues = new double[big.size()];
      // How many result values have been filled so far.
      int resultInd = 0;
  
      // Current positions in each tensor's key/value array.
      int bigInd = 0;
      int smallInd = advanceToNonzero(-1, small);
  
      long smallIndexMultiplier = 1;
      for (int i = big.numDimensions() - 1; i >= small.numDimensions(); i--) {
        smallIndexMultiplier *= ((long) big.getDimensionSizes()[i]);
      }
  
      // Variables for the binary search
      int startInd, endInd, cmpInd;
      long targetKeyNum;
  
      // Caches to avoid recomputing method values.
      int bigSize = big.size();
      int smallSize = small.size();
      long bigKeyNum, smallKeyNum, bigKeyNumDividedByMultiplier;
      double[] bigValues = big.values;
      long[] bigKeyNums = big.keyNums;
      outerloop: for (bigInd = 0; bigInd < bigSize && smallInd < smallSize;) {
  
        // Advance smallInd until other's outcome is >= our outcome.
        bigKeyNum = big.indexToKeyNum(bigInd);
        bigKeyNumDividedByMultiplier = bigKeyNum / smallIndexMultiplier;
        while (bigKeyNumDividedByMultiplier > small.indexToKeyNum(smallInd) ||
            small.getByIndex(smallInd) == 0) {
          smallInd++;
          if (smallInd >= smallSize) {
            break outerloop;
          }
        }
        smallKeyNum = small.indexToKeyNum(smallInd);
  
        if (bigKeyNumDividedByMultiplier == smallKeyNum) {
          resultKeyInts[resultInd] = bigKeyNum;
          resultValues[resultInd] = bigValues[bigInd] * small.getByIndex(smallInd);
          resultInd++;
          bigInd++;
        } else {
          // Advance bigInd by a large amount.
  
          // Find a block of outcomes with the correct starting
          // coordinates. This performs a binary search between the
          // starting value of bigInd and the end of the array.
          startInd = bigInd + 1;
          endInd = bigSize;
          targetKeyNum = smallKeyNum * smallIndexMultiplier;
          while (startInd != endInd) {
            cmpInd = (startInd + endInd) / 2;
            if (targetKeyNum > bigKeyNums[cmpInd]) {
              startInd = cmpInd + 1;
            } else {
              endInd = cmpInd;
            }
          }
          bigInd = startInd;
        }
      }
      return resizeIntoTable(big.getDimensionNumbers(), big.getDimensionSizes(),
          resultKeyInts, resultValues, resultInd);
    }