code: def _check_observer_method(self, model, num_observers):
      qconfig_dict = {"": default_dynamic_qconfig}
      inputs = model.get_example_inputs()
      orig_scripted_model = get_script_module(model, False, inputs)
      torch._C._jit_pass_inline(orig_scripted_model.graph)
      orig_forward_graph = orig_scripted_model.graph.str()
      scripted_model = OnDevicePTQUtils.insert_observers(
          model, qconfig_dict
      )
      quant_forward_graph = scripted_model.graph.str()
      # exact graph matching is difficult so just resorting to # of lines
      # instead of implementing graph matching
      self.assertEqual(
          len(orig_forward_graph.splitlines()),
          len(quant_forward_graph.splitlines()),
      )
      observe_method = scripted_model.observe_forward.graph
      FileCheck().check_count(
          'prim::CallMethod[name="forward"](%_observer',
          num_observers,
          exactly=True,
      ).run(observe_method)
      reset_observers_method = (
          scripted_model.reset_observers_forward.graph
      )
      FileCheck().check_count(
          'prim::CallMethod[name="reset_min_max_vals"](%_observer',
          num_observers,
          exactly=True,
      ).run(reset_observers_method)
  
imports: import torch
  import torch._C
  from torch.ao.quantization import default_dynamic_qconfig, per_channel_dynamic_qconfig
  from torch.ao.quantization.quantize_jit import prepare_dynamic_jit, convert_dynamic_jit, _prepare_ondevice_dynamic_jit, _quantize_ondevice_dynamic_jit
  from torch.testing._internal.common_utils import TestCase
  from torch.testing._internal.common_quantization import get_script_module, LinearAddModel
  from torch.jit.mobile import _load_for_lite_interpreter, LiteScriptModule
  from torch.testing import FileCheck
  from torch.utils import bundled_inputs
  import io
  from typing import Dict
label_desc: Use image node_id 2 for calling the TestOnDeviceDynamicPTQInsertObservers obj's underlying member method code with example usage: obj._check_observer_method(model, num_observers) without return types