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

Fix Tensor.tolist() #134

Closed
yizhuoz004 opened this issue Aug 20, 2024 · 5 comments
Closed

Fix Tensor.tolist() #134

yizhuoz004 opened this issue Aug 20, 2024 · 5 comments

Comments

@yizhuoz004
Copy link
Collaborator

memoryview(memref).tolist() does not print the values as expected for some dtypes, such as bfloat16, float8.
Also consider move tolist() and pretty_print APIs to MLIR-TRT's python bindings.

@yizhuoz004
Copy link
Collaborator Author

Also the float16 memoryview cannot return nested lists:

>>> a = np.ones((2, 2), dtype=np.float16)
>>> b = tp.Tensor(a)
>>> b
tensor(
    [1.0000, 1.0000, 1.0000, 1.0000],
    dtype=float16, loc=gpu:0, shape=[2, 2])

@pranavm-nvidia
Copy link
Collaborator

@yizhuoz004 does #95 resolve this?

@yizhuoz004
Copy link
Collaborator Author

@yizhuoz004 does #95 resolve this?

No this is still open.

@pranavm-nvidia
Copy link
Collaborator

I think #254 addresses this. Do we still want to consider moving tolist and pretty_print to MLIR-TRT?

@yizhuoz004
Copy link
Collaborator Author

Not necessary for now. Let's close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants