code: def __init__(
      self, n, batch_size, dims=[2], as_tensor=False, device="cuda"
  ):
      self.batch_size = batch_size
      self.dims = dims
      self.n = n
      self.as_tensor = as_tensor
      self.i = 0
      self.device = device
  
file_path: DALI/dali/test/python/test_external_source_pytorch_dlpack.py
imports: import numpy
  import nvidia.dali.fn
  import nvidia.dali.ops
  import torch
  from nvidia.dali.backend_impl import *
  from nvidia.dali import Pipeline
  from torch.utils.dlpack import to_dlpack, from_dlpack
  from test_utils import check_output
label_desc: Use image node_id 1 to create a new TestIterator object  with example: obj = TestIterator(n, batch_size, dims, as_tensor, device)