docs: protected static final SparseTensor elementwiseMultiplyNaive(SparseTensor big, Tensor small) {
      // Compute a mapping from keyNums of big to keyNums of small.
      int[] bigDimensions = big.getDimensionNumbers();
      int[] smallDimensions = small.getDimensionNumbers();
      int[] bigDimensionSizes = big.getDimensionSizes();
      int smallDimensionInd = smallDimensions.length - 1;
      int bigDimensionInd = bigDimensions.length - 1;
      // divisors, modulos and multipliers store the mapping from
      // bigKeyNum to
      // smallKeyNum.
      // They contain a series of division, modulo and multiplication
      // operations
      // whose results are added to get a smallKeyNum.
      long[] divisors = new long[smallDimensions.length];
      long[] modulos = new long[smallDimensions.length];
      long[] multipliers = new long[smallDimensions.length];
      int divisorInd = 0;
      long divisor = 1;
      long multiplier = 1;
      long modulo = 1;
      while (bigDimensionInd >= 0 && smallDimensionInd >= 0) {
        while (bigDimensions[bigDimensionInd] != smallDimensions[smallDimensionInd]) {
          divisor *= bigDimensionSizes[bigDimensionInd];
          bigDimensionInd--;
        }
        divisors[divisorInd] = divisor;
  
        modulo = 1;
        while (bigDimensionInd >= 0 && smallDimensionInd >= 0 &&
            bigDimensions[bigDimensionInd] == smallDimensions[smallDimensionInd]) {
          divisor *= bigDimensionSizes[bigDimensionInd];
          modulo *= bigDimensionSizes[bigDimensionInd];
          bigDimensionInd--;
          smallDimensionInd--;
        }
        modulos[divisorInd] = modulo;
        multipliers[divisorInd] = multiplier;
        divisorInd++;
        multiplier *= modulo;
      }
  
      // 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;
  
      long bigKeyNum, smallKeyNum;
      double value;
      int numElements = big.size();
      for (int bigInd = 0; bigInd < numElements; bigInd++) {
        bigKeyNum = big.indexToKeyNum(bigInd);
        // map bigKeyNum to a smallKeyNum
        smallKeyNum = 0;
        for (int i = 0; i < divisorInd; i++) {
          smallKeyNum += ((bigKeyNum / divisors[i]) % modulos[i]) * multipliers[i];
        }
        value = small.get(smallKeyNum);
  
        if (value != 0.0) {
          resultKeyInts[resultInd] = bigKeyNum;
          resultValues[resultInd] = value * big.getByIndex(bigInd);
          resultInd++;
        }
      }
  
      return resizeIntoTable(big.getDimensionNumbers(), big.getDimensionSizes(), resultKeyInts,
          resultValues, resultInd);
    }