Skip to content

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
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