code: def test_propogation():
      r""" The network and devices are as follows:
                    x             <--- CPU
                    |
                  negative        <--- CPU
                  /   \
            negative  negative    <--- GPU
                  \   /
                   add            <--- GPU
                    |
                  negative        <--- CPU
                    |
                 <result>         <--- CPU
      """
      metatable = {"VirtualDevice": [CPU, GPU]}
  
      def input():
          return tvm.relay.parse(
              """
              #[version = "0.0.5"]
              def @main(%x: Tensor[(5, 7), float32]) {
                %0 = negative(%x);
                %1 = on_device(%0, virtual_device=meta[VirtualDevice][0]);
                %2 = negative(%1);
                %3 = on_device(%0, virtual_device=meta[VirtualDevice][0]);
                %4 = negative(%3);
                %5 = on_device(%2, virtual_device=meta[VirtualDevice][1]);
                %6 = on_device(%4, virtual_device=meta[VirtualDevice][1]);
                %7 = add(%5, %6);
                %8 = on_device(%7, virtual_device=meta[VirtualDevice][1]);
                %9 = negative(%8);
                on_device(%9, virtual_device=meta[VirtualDevice][0])
              }
          """,
              "from_string",
              None,
              metatable,
          )
  
      def expected():
          return tvm.relay.parse(
              """
              #[version = "0.0.5"]
              def @main(%x {virtual_device=meta[VirtualDevice][0]}: Tensor[(5, 7), float32],
                        virtual_device=meta[VirtualDevice][0]) {
                %0 = negative(%x);
                %1 = on_device(%0, virtual_device=meta[VirtualDevice][0], constrain_result=True);
                %2 = device_copy(%1, src_virtual_device=meta[VirtualDevice][0], dst_virtual_device=meta[VirtualDevice][1]);
                %3 = on_device(%0, virtual_device=meta[VirtualDevice][0], constrain_result=True);
                %4 = device_copy(%3, src_virtual_device=meta[VirtualDevice][0], dst_virtual_device=meta[VirtualDevice][1]);
                %5 = negative(%2);
                %6 = negative(%4);
                %7 = add(%5, %6);
                %8 = on_device(%7, virtual_device=meta[VirtualDevice][1], constrain_result=True);
                %9 = device_copy(%8, src_virtual_device=meta[VirtualDevice][1], dst_virtual_device=meta[VirtualDevice][0]);
                negative(%9)
              }
          """,
              "from_string",
              None,
              metatable,
          )
  
      def ref(x):
          y = np.negative(x)
          return np.negative(np.add(np.negative(y), np.negative(y)))
  
      exercise(input(), expected(), ref, rands((5, 7), 1))
  
imports: import tvm
  from tvm import relay
  from tvm.script import tir
  import tvm.testing
  import numpy
  import os
label_desc: Use image node_id 28 for calling a global function with example usage: test_propogation() and returns: tvm, tvm, np