code: def test_on_device_via_string():
      x = relay.Var("x")
      call = relay.annotation.on_device(x, "cuda")
      assert isinstance(call, relay.Call)
      assert len(call.args) == 1
      assert call.args[0] == x
      assert (
          call.attrs.virtual_device.device_type_int == 2
      )  # ie kDLCUDA
      assert call.attrs.virtual_device.virtual_device_id == 0
      assert call.attrs.virtual_device.target is None
      assert call.attrs.virtual_device.memory_scope == ""
      assert call.attrs.constrain_body
      assert not call.attrs.constrain_result
  
file_path: tvm/tests/python/relay/op/annotation/test_annotation.py
imports: import tvm
  import tvm.testing
  from tvm import relay
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_on_device_via_string() without return types