class_docstr: Detects the first NaN or Inf in forward and/or backward pass and logs, together with the module name
class_docstr_tok: ["Detects","the","first","NaN","or","Inf","in","forward","and\/or","backward","pass","and","logs",",","together","with","the","module","name"]
code: def close(self):
      for hook in self.fhooks + self.bhooks:
          hook.remove()
  
file_path: fairseq/fairseq/nan_detector.py
imports: import logging
  import torch
label_desc: Use image node_id 10 for calling the NanDetector obj's underlying member method code with example usage: obj.close() without return types