code: def _transform_data_to_tensorlist(
      data, batch_size, layout=None, device_id=-1
  ):
      data = _prep_data_for_feed_input(
          data, batch_size, layout, device_id
      )
  
      if isinstance(data, list):
          if isinstance(data[0], _tensors.TensorGPU):
              data = _tensors.TensorListGPU(data, layout or "")
          else:
              data = _tensors.TensorListCPU(data, layout or "")
  
      return data
  
imports: import sys
  from nvidia.dali import backend
  from nvidia.dali import internal
  from nvidia.dali import ops
  from nvidia.dali import tensors
  from nvidia.dali import types
  from nvidia.dali.external_source import _prep_data_for_feed_input
label_desc: Use image node_id 1 for calling a global function with example usage: _transform_data_to_tensorlist(data, batch_size, layout, device_id) and returns: data