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

MLXArray (Data, Dtype) constructor , DType size. #158

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

louen
Copy link

@louen louen commented Oct 24, 2024

This PR provides a fix for #157 by offering a new convenience initializer for MLXArray.

DRAFT: This is waiting on ml-explore/mlx-c#39

MLXArray init from data

  • new constructor for MLXArray taking Data, an optional shape (assuming a 1D array if unspecified) and a dtype.
  • should behave similarly as existing constructor daking Data and an explicit HasDtype type.

Modifications to DType

  • DType enum now conforms to Codable (saving the underlying raw value)
  • DType enum is now CaseIterable (mostly useful for testing all dtypes)
  • Dtype now expose size as a computed variable (Expose DType size through the C api mlx-c#39), the memory size of the associated type

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.

1 participant