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