code: def test_cast_like(devices, dtype_in, dtype_out):
      @pipeline_def(batch_size=1, num_threads=4, device_id=0)
      def cast_pipe():
          device_left, device_right = devices
          data0 = fn.random.uniform(
              range=[0, 255],
              dtype=np_type_to_dali(dtype_in),
              device=device_left,
          )
          data1 = fn.random.uniform(
              range=[0, 255],
              dtype=np_type_to_dali(dtype_out),
              device=device_right,
          )
          return fn.cast_like(data0, data1)
  
      p = cast_pipe()
      p.build()
      (out,) = p.run()
      expected_type = np_type_to_dali(dtype_out)
      assert (
          out.dtype == expected_type
      ), f"{out.dtype} != {expected_type}"
  
file_path: DALI/dali/test/python/operator_1/test_cast.py
imports: import numpy
  import nvidia.dali.fn
  import nvidia.dali.types
  from nose.tools import nottest
  from nvidia.dali import pipeline_def
  from test_utils import np_type_to_dali
  import itertools
  from nose2.tools import params
label_desc: Use image node_id 8 for calling a global function with example usage: test_cast_like(devices, dtype_in, dtype_out) and returns: fn