code: public int count(double val) {
          int count = 0;
          for (int i=0; i<this.size(); i++) {
              if (this.getValue(i) == val) {
                  count++;
              }
          }
          return count;
      }
docs: Gets the number of times a given value occurs in the Tensor (exact match).