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