Skip to content

Conversation

@forfudan
Copy link
Collaborator

Adds the Flags type for storing information on memory layout. It replaces the current Dict[String, Bool] type. The Flags object can also be accessed dictionary-like. Short names are available for convenience. It is similar to numpy.flags object. Example:

fn main() raises:
    var A = nm.random.rand(2, 3, 4)
    print(A.flags.C_CONTIGUOUS)
    print(A.flags["C_CONTIGUOUS"])
    print(A.flags["C"])

They all print True.

@shivasankarka shivasankarka merged commit 718d748 into Mojo-Numerics-and-Algorithms-group:pre-0.6 Feb 13, 2025
2 checks passed
@forfudan forfudan deleted the flags branch February 13, 2025 11:23
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