code: def test_wrong_arg_backend():
      @pipeline_def(batch_size=1, num_threads=1, device_id=0)
      def make_pipe():
          fake_data = types.Constant(
              0, shape=[10, 10, 3], dtype=types.FLOAT, device="cpu"
          )
          rel_start = fn.random.uniform(
              range=[0.0, 0.3],
              shape=(2,),
              dtype=types.FLOAT,
              device="gpu",
          )
          rel_shape = fn.random.uniform(
              range=[0.4, 0.6],
              shape=(2,),
              dtype=types.FLOAT,
              device="gpu",
          )
          sliced = fn.slice(
              fake_data, rel_start, rel_shape, device="cpu"
          )
          return sliced
  
      with assert_raises(
          ValueError,
          glob="An operator with device='cpu' cannot accept GPU inputs",
      ):
          p = make_pipe()
          p.build()
          p.run()
  
imports: from nvidia.dali import Pipeline, pipeline_def, ops, fn, types
  import numpy
  import os
  from functools import partial
  from math import floor
  from test_utils import compare_pipelines, get_dali_extra_path, RandomDataIterator, generator_random_axes_for_3d_input, generator_random_data, as_array
  from nose_utils import assert_raises
  from nose2.tools import params
label_desc: Use image node_id 34 for calling a global function with example usage: test_wrong_arg_backend() and returns: sliced