Skip to content

Commit

Permalink
[Relay][vm] Small bug fix for DataTypeObject (apache#3604)
Browse files Browse the repository at this point in the history
* small bug fix for DataTypeObject

* retrigger ci
  • Loading branch information
zhiics authored and wweic committed Aug 9, 2019
1 parent b911eb4 commit 31a8d76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/relay/backend/vmobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __getitem__(self, idx):
return self.fields[idx]

def __len__(self):
return self.num_fields
return len(self.fields)

def __iter__(self):
return iter(self.fields)
Expand Down
3 changes: 3 additions & 0 deletions tests/python/relay/test_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ def test_list_constructor():
mod["main"] = f

result = veval(mod)
assert len(result) == 2
assert len(result[1]) == 2

obj = vmobj_to_list(result)
tvm.testing.assert_allclose(obj, np.array([3,2,1]))

Expand Down

0 comments on commit 31a8d76

Please sign in to comment.