code: def nan_to_num(self, x):
      device = x.device
      x = x.cpu().numpy()
      x = np.nan_to_num(
          x=x, copy=False, nan=0.0, posinf=0.0, neginf=0.0
      )
      return torch.from_numpy(x).to(device)
  
file_path: DeepSpeed/deepspeed/runtime/eigenvalue.py
imports: import torch
  from deepspeed.utils import log_dist
  import numpy
  import logging
label_desc: Use image node_id 2 for calling the Eigenvalue obj's underlying member method code with example usage: obj.nan_to_num(x) and returns: torch