class_docstr: Worker class of LOBPCG methods.
class_docstr_tok: ["Worker","class","of","LOBPCG","methods","."]
docstr: Determine the number of converged eigenpairs using backward stable
  convergence criterion, see discussion in Sec 4.3 of [DuerschEtal2018].
  
  Users may redefine this method for custom convergence criteria.
docstr_tok: ["Determine","the","number","of","converged","eigenpairs","using","backward","stable","convergence","criterion",",","see","discussion","in","Sec","4.3","of","[","DuerschEtal2018","]",".","Users","may","redefine","this","method","for","custom","convergence","criteria","."]
code: def update_converged_count(self):
      """Determine the number of converged eigenpairs using backward stable
      convergence criterion, see discussion in Sec 4.3 of [DuerschEtal2018].
  
      Users may redefine this method for custom convergence criteria.
      """
      # (...) -> int
      prev_count = self.ivars["converged_count"]
      tol = self.fparams["tol"]
      A_norm = self.fvars["A_norm"]
      B_norm = self.fvars["B_norm"]
      E, X, R = self.E, self.X, self.R
      rerr = (
          torch.norm(R, 2, (0,))
          * (
              torch.norm(X, 2, (0,))
              * (A_norm + E[: X.shape[-1]] * B_norm)
          )
          ** -1
      )
      converged = rerr < tol
      count = 0
      for b in converged:
          if not b:
              # ignore convergence of following pairs to ensure
              # strict ordering of eigenpairs
              break
          count += 1
      assert (
          count >= prev_count
      ), f"the number of converged eigenpairs (was {prev_count}, got {count}) cannot decrease"
      self.ivars["converged_count"] = count
      self.tvars["rerr"] = rerr
      return count
  
imports: from typing import Dict, Optional, Tuple
  import torch
  from torch import Tensor
  from .None import _linalg_utils
  from .overrides import handle_torch_function, has_torch_function
label_desc: Use image node_id 5 for calling the LOBPCG obj's underlying member method code with example usage: obj.update_converged_count() and returns: count