code: def _validate_packed_params(self, model, num_nodes, per_channel=0):
      quantize_forward_graph = model.quantize_forward.graph
      quantize_per_tensor = quantize_per_channel = 0
      linear_prepack = 0
      linear_prepack_uses = 0
      for n in quantize_forward_graph.nodes():
          if n.kind() == "prim::SetAttr":
              maybe_packed_param_value = n.inputsAt(1)
              maybe_packed_param = maybe_packed_param_value.node()
              if (
                  maybe_packed_param.kind()
                  == "quantized::linear_prepack"
              ):
                  linear_prepack += 1
                  linear_prepack_uses += len(
                      maybe_packed_param_value.uses()
                  )
                  if OnDevicePTQUtils.is_per_channel_quantized_packed_param(
                      maybe_packed_param
                  ):
                      quantize_per_channel += 1
                  else:
                      quantize_per_tensor += 1
      self.assertEqual(
          quantize_per_tensor + quantize_per_channel, num_nodes
      )
      self.assertEqual(quantize_per_channel, per_channel)
      self.assertEqual(linear_prepack, num_nodes)
      self.assertEqual(linear_prepack_uses, num_nodes)
  
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 1 for calling the TestOnDeviceDynamicPTQFinalize obj's underlying member method code with example usage: obj._validate_packed_params(model, num_nodes, per_channel) without return types