class_docstr: After every model forward, verify the loss is not infinite.
  Called for both training/test phase.
class_docstr_tok: ["After","every","model","forward",",","verify","the","loss","is","not","infinite",".","Called","for","both","training\/test","phase","."]
code: def __init__(self, world_size: int):
      super().__init__()
      self.world_size = world_size
  
imports: import logging
  import time
  import torch
  from classy_vision import tasks
  from classy_vision.generic.profiler import compute_activations, compute_flops, count_params
  from classy_vision.hooks.classy_hook import ClassyHook
  from fvcore.common.file_io import PathManager
  from vissl.data import AirstoreDataset, GenericSSLDataset
  from vissl.models.model_helpers import model_output_has_nan
  from vissl.utils.env import get_machine_local_and_dist_rank
label_desc: Use image node_id 1 to create a new CheckNanModelOutputHook object from inherited base classes: ClassyHook with example: obj = CheckNanModelOutputHook(world_size)