Skip to content

Commit

Permalink
Fix serialization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
electriclilies committed Jan 6, 2022
1 parent 8cc9930 commit 592cf52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/relay/ir/expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Var WithFields(Var var, Optional<Id> opt_vid, Optional<Type> opt_type_annotation
VarNode* cow_var_node = var.CopyOnWrite();
cow_var_node->vid = vid;
cow_var_node->type_annotation = type_annotation;
cow_var_node->virtual_device_ = var->virtual_device();
cow_var_node->virtual_device_ = virtual_device;
cow_var_node->span = span;
}
return var;
Expand Down
6 changes: 3 additions & 3 deletions tests/python/relay/test_json_compact.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_var():
{"type_key": ""},
{
"type_key": "relay.Var",
"attrs": {"_checked_type_": "0", "span": "0", "type_annotation": "0", "vid": "2"},
"attrs": {"_checked_type_": "0", "span": "0", "type_annotation": "0", "vid": "2", "virtual_device_": "0"},
},
{"type_key": "relay.Id", "attrs": {"name_hint": "a3"}},
{"type_key": "relay.TensorType", "attrs": {"dtype": "float32", "shape": "4", "span": "0"}},
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_global_var():
{"type_key": ""},
{
"type_key": "relay.GlobalVar",
"attrs": {"_checked_type_": "0", "name_hint": "x", "span": "0"},
"attrs": {"_checked_type_": "0", "name_hint": "x", "span": "0", "virtual_device_": "0"},
},
]
data = {
Expand All @@ -130,7 +130,7 @@ def test_global_var():
assert isinstance(tvar, tvm.ir.GlobalVar)
nodes = [
{"type_key": ""},
{"type_key": "GlobalVar", "attrs": {"_checked_type_": "0", "name_hint": "x", "span": "0"}},
{"type_key": "GlobalVar", "attrs": {"_checked_type_": "0", "name_hint": "x", "span": "0", "virtual_device_": "0"}},
]
data = {
"root": 1,
Expand Down

0 comments on commit 592cf52

Please sign in to comment.