code: def test_compose_change_device():
      batch_size = 3
      pipe = Pipeline(batch_size, 1, 0)
  
      size = fn.random.uniform(shape=2, range=(300, 500))
      c = ops.Compose(
          [
              ops.decoders.Image(device="cpu"),
              ops.Resize(size=size, device="gpu"),
          ]
      )
      files, labels = fn.readers.caffe(path=caffe_db_folder, seed=1)
      pipe.set_outputs(
          c(files), fn.resize(fn.decoders.image(files).gpu(), size=size)
      )
  
      pipe.build()
      out = pipe.run()
      assert isinstance(out[0], dali.backend.TensorListGPU)
      test_utils.check_batch(out[0], out[1], batch_size=batch_size)
  
file_path: DALI/dali/test/python/operator_1/test_compose.py
imports: import numpy
  import os
  import nvidia.dali
  import nvidia.dali.fn
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import test_utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_compose_change_device() without return types