code: public boolean containsNaN() {
          for (int c = 0; c < this.size(); c++) {
              if (s.isNaN(this.getValue(c))) {
                  return true;
              }
          }
          return false;
      }
docs: Returns true if this tensor contains any NaNs.