class_docstr: Plugin for understanding/debugging model inference.
    
class_docstr_tok: ["Plugin","for","understanding\/debugging","model","inference","."]
docstr: Constructs an interactive inference plugin for TensorBoard.
  
  Args:
    context: A base_plugin.TBContext instance.
code: def __init__(self, context):
      """Constructs an interactive inference plugin for TensorBoard.
  
      Args:
        context: A base_plugin.TBContext instance.
      """
      self._logdir = context.logdir
      self._wit_data_dir = (
          context.flags.wit_data_dir if context.flags else None
      )
  
      self.custom_predict_fn = None
      if context.flags and context.flags.custom_predict_fn:
          try:
              import importlib.util as iu
  
              spec = iu.spec_from_file_location(
                  "custom_predict_fn", context.flags.custom_predict_fn
              )
              module = iu.module_from_spec(spec)
              spec.loader.exec_module(module)
              self.custom_predict_fn = module.custom_predict_fn
              logger.info("custom_predict_fn loaded.")
  
          except Exception as e:
              logger.error(str(e))
              logger.error(
                  "Failed to load the custom predict function."
              )
              logger.error(
                  "Have you defined a function named custom_predict_fn?"
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import io
  import json
  import logging
  import math
  import numpy
  import os
  import werkzeug
  from werkzeug import wrappers
  from six.moves import xrange
  from google.protobuf import json_format
  from grpc.framework.interfaces.face.face import AbortionError
  from werkzeug import wrappers
  import tensorflow
  from tensorboard.backend import http_util
  from tensorboard.plugins import base_plugin
  from utils import common_utils
  from utils import inference_utils
  from utils import platform_utils
label_desc: Use image node_id 1 to create a new WhatIfToolPlugin object from inherited base classes: base_plugin with example: obj = WhatIfToolPlugin(context)