code: def test_fusible_network():
      r""" The network is as follows:
                 x     y      <--- GPU
                  \   /
                   add        <--- GPU
                  /   \
             negative  \      <--- CPU
                \       \
                 \  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], %y: Tensor[(5, 7), float32]) {
                %0 = add(%x, %y);
                %1 = on_device(%0, virtual_device=meta[VirtualDevice][1]);
                %2 = negative(%1);
                %3 = on_device(%2, virtual_device=meta[VirtualDevice][0]);
                %4 = negative(%0);
                %5 = add(%3, %4);
                %6 = on_device(%5, virtual_device=meta[VirtualDevice][1]);
                %7 = negative(%6);
                on_device(%7, 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][1]}: Tensor[(5, 7), float32], %y {virtual_device=meta[VirtualDevice][1]}: Tensor[(5, 7), float32],
                        virtual_device=meta[VirtualDevice][0]) {
                %0 = add(%x, %y);
                %1 = on_device(%0, virtual_device=meta[VirtualDevice][1], constrain_result=True);
                %2 = device_copy(%1, src_virtual_device=meta[VirtualDevice][1], dst_virtual_device=meta[VirtualDevice][0]);
                %3 = negative(%2);
                %4 = on_device(%3, virtual_device=meta[VirtualDevice][0], constrain_result=True);
                %5 = device_copy(%4, src_virtual_device=meta[VirtualDevice][0], dst_virtual_device=meta[VirtualDevice][1]);
                %6 = negative(%0);
                %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):
          z = np.add(x, y)
          return np.negative(np.add(np.negative(z), np.negative(z)))
  
      exercise(input(), expected(), ref, rands((5, 7), 2))
  
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 29 for calling a global function with example usage: test_fusible_network() and returns: tvm, tvm, np