code: def _check_sequence_inside_sequence(self, tensor_1, tensor_2):
      # check if tensor_1 inside tensor_2 or tensor_2 inside tensor_1.
      # set to same device. we don't care what device.
  
      if not isinstance(tensor_1, list):
          tensor_1 = tensor_1.cpu().tolist()
      if not isinstance(tensor_2, list):
          tensor_2 = tensor_2.cpu().tolist()
  
      in_order = len(tensor_1) <= len(tensor_2)
      longer = tensor_2 if in_order else tensor_1
      shorter = tensor_1 if in_order else tensor_2
  
      flag = False
      chunk_size = len(shorter)
      for chunk_idx in range(len(longer) - chunk_size + 1):
          subseq = longer[chunk_idx : chunk_idx + chunk_size]
          if subseq == shorter:
              flag = True
              break
  
      return flag
  
imports: import unittest
  from transformers import is_torch_available
  from transformers.testing_utils import require_torch, torch_device
  from ..test_modeling_common import floats_tensor, ids_tensor
label_desc: Use image node_id 7 for calling the ConstrainedBeamSearchTester obj's underlying member method code with example usage: obj._check_sequence_inside_sequence(tensor_1, tensor_2) and returns: flag