code: public boolean containsNaN() {
          for (int i = 0; i < values.length; i++) {
              if (s.isNaN(values[i])) {
                  return true;
              }
          }
          return false;
      }
docs: Returns true if this tensor contains any NaNs.