class_docstr: An utility API to create function_hook callbacks to check whether the outputs of all layers have NaN or inf as their values.
  During forward and backward execution, passed as function_hook,
  this API reports ValueError if at least one of all layer outputs has Nan or inf as its values.
  Otherwise, all tensors passed to next layer or function as is.
  
  Example:
  
  .. code-block:: python
  
      pred = model(...)
  
      from nnabla.utils.inspection import NanInfTracer
      nit = NanInfTracer(trace_inf=True, trace_nan=True, need_details=True)
  
      with nit.trace():
          pred.forward(function_post_hook=nit.forward_post_hook)
          pred.backward(function_post_hook=nit.backward_post_hook)
class_docstr_tok: ["An","utility","API","to","create","function_hook","callbacks","to","check","whether","the","outputs","of","all","layers","have","NaN","or","inf","as","their","values",".","During","forward","and","backward","execution",",","passed","as","function_hook",",","this","API","reports","ValueError","if","at","least","one","of","all","layer","outputs","has","Nan","or","inf","as","its","values",".","Otherwise",",","all","tensors","passed","to","next","layer","or","function","as","is",".","Example",":","..","code-block",":",":","python","pred","=","model","(","...",")","from","nnabla.utils.inspection","import","NanInfTracer","nit","=","NanInfTracer","(","trace_inf=True",",","trace_nan=True",",","need_details=True",")","with","nit.trace","(",")",":","pred.forward","(","function_post_hook=nit.forward_post_hook",")","pred.backward","(","function_post_hook=nit.backward_post_hook",")"]
code: def pre_hook(self):
      # Perform nothing for pre_hook.
      return None
  
file_path: nnabla/python/src/nnabla/utils/inspection/value_trace.py
imports: from __future__ import absolute_import
  from collections import OrderedDict
  from contextlib import contextmanager
  import nnabla.functions
  from .base import FunctionHookCallbackBase
label_desc: Use image node_id 3 for calling the NanInfTracer obj's underlying member method code with example usage: obj.pre_hook() and returns: None