code: def _check_whether_add_label(model, dataloader, input_sample=None):
      """
      This function is used to check if the dataloader(calib_data) needs
      to add a (dummy) label at last.
      """
      # get forward method's parameter number and input sample
      forward_args = get_conditional_args(
          model,
          include="all",
          exclude=(
              bool,
              type(None),
          ),
      )
      forward_args_len = len(forward_args)
      loader_input_sample = next(iter(dataloader))
  
      if isinstance(loader_input_sample, torch.Tensor):
          # only one tensor provided, clearly we need a dummy label
          if forward_args_len >= 1:
              return True
      elif input_sample is not None:
          if isinstance(input_sample, torch.Tensor):
              # input_sample is a Tensor
              if len(loader_input_sample) > 1:
                  return False
              return True
          if len(loader_input_sample) > len(input_sample):
              # input_sample is also a sequence
              return False
      if isinstance(loader_input_sample, Sequence):
          if (
              isinstance(loader_input_sample[0], Sequence)
              and len(loader_input_sample[0]) == forward_args_len
          ):
              # this means user returns a (x1, x2, ...), y
              return False
          else:
              if len(loader_input_sample) > forward_args_len:
                  # this means users dataset returns at least 1 label
                  return False
              else:
                  # test run to check if whole sample can be used for inference
                  try:
                      model(*loader_input_sample)
                      return True
                  except Exception:
                      pass
                  if len(loader_input_sample) == 2:
                      try:
                          model(loader_input_sample[0])
                          return False
                      except Exception:
                          if isinstance(
                              loader_input_sample[0], Sequence
                          ):
                              try:
                                  model(*loader_input_sample[0])
                                  return False
                              except Exception:
                                  # input sample don't contain label
                                  return True
                          else:
                              return True
      return False
  
file_path: BigDL/python/nano/src/bigdl/nano/utils/pytorch/dataloader.py
imports: from typing import Sequence
  from copy import deepcopy
  import torch
  import warnings
  from bigdl.nano.utils.pytorch import get_conditional_args
label_desc: Use image node_id 4 for calling a global function with example usage: _check_whether_add_label(model, dataloader, input_sample) and returns: False, True, False, True, False, False, False, True, False, True, False, True