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

[Runtime] Implemented Datatype.itemsize() #16880

Merged
merged 4 commits into from
Apr 14, 2024
Merged

Conversation

vinx13
Copy link
Member

@vinx13 vinx13 commented Apr 13, 2024

Added a utility method itemsize to DataType, this is similar to numpy.array.itemsize

cc @tqchen

@github-actions github-actions bot requested a review from tqchen April 13, 2024 03:21
lanes_as_int = ctypes.c_int16(self.lanes).value
if lanes_as_int < 0:
raise ValueError("Cannot determine itemsize for scalable vector types")
return self.bits * self.lanes // 8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(self.bits * self.lanes + 7) // 8

@tqchen tqchen merged commit 64911ab into apache:main Apr 14, 2024
19 checks passed
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

Successfully merging this pull request may close these issues.

2 participants