Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relay][vm] Small bug fix for DataTypeObject #3604

Merged
merged 2 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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