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

Updating The Array Module #28

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Updating The Array Module #28

merged 2 commits into from
Oct 3, 2023

Conversation

erfanzar
Copy link
Owner

@erfanzar erfanzar commented Oct 3, 2023

Updating The Array Module with Adding and Changing Added Methods Are:

fn __init__(inout self: Self, array_shape: ArrayShape):

  • Description: Init Array From ArrayShape(Alloc Zero).

fn __init__(inout self: Self, A: Self, B: Self) -> None:

  • Description: Init Array From Two other Arrays A and B For Matmul(Alloc One).

fn __init__(inout self: Self, vl: VariadicList[Int]):

  • Description: Init Array from VariadicList[Int](Alloc Zero).

fn __init__(inout self: Self, init: Bool, *dim: Int) -> None:

  • Description: Init Array from Int Args(Depends on Passed Bool).

fn __init__(inout self: Self, *dim: Int):

  • Description: Init Array from Int Args(Alloc Zero).

fn __init__(inout self: Self, value: DynamicVector[FloatLiteral], shape: ArrayShape) -> None:

  • Description: Init Array from ArrayShape and load data from DynamicVector[FloatLiteral](Alloc One).

fn __init__(inout self: Self, value: VariadicList[FloatLiteral], shape: ArrayShape) -> None:

  • Description: Init Array from ArrayShape and load data from VariadicList[FloatLiteral](Alloc One).

fn __init__(inout self: Self, pointer: DTypePointer[T], *dim: Int) -> None:

  • Description: Init Array from IntArgs and load data from DTypePointer[T](Alloc One).

Alloc

fn alloc(inout self: Self) -> None:

  • Description: Allocate or Init The Array.

Random

fn random(inout self: Self) -> None:

  • Description: Randomize The Data if the Array is Allocated.

@erfanzar erfanzar merged commit f9c59cd into main Oct 3, 2023
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