code: public double getSum() {
          double sum = s.zero();
          for (int c = 0; c < this.values.length; c++) {
              sum = s.plus(sum, values[c]);
          }
          return sum;
      }
docs: Gets the sum of all the entries in this tensor.