Numpy creation routines vs NuMojo creation routines #90
Replies: 3 comments
-
I do believe that we have such kind of functions in |
Beta Was this translation helpful? Give feedback.
-
I think it is better to have simple initializers, with as few arguments as possible. There are too many types of special case Matrices (let alone Tensors) to put them all in the initializer. Also in my opinion we already have too many I would prefer special arrays to be generated by functions defined outside of the Struct and preferably sorted into their correct subcategory if they are not one of the basic generations routines. This will also make things neater once we are dealing with more than one array struct, and we switch to using Trait types in our functions (for when Mojo adds Classes and we can make a more dynamic Array class, or if we want to make a compile-time array Struct). |
Beta Was this translation helpful? Give feedback.
-
I agree with @MadAlex1997 , we have too many initializers, and this can be confusing and maybe even complicated for the repo to document or make changes in the future. I'll move the random initializers from pr #88 to the |
Beta Was this translation helpful? Give feedback.
-
I was looking at the Numpy documentation and I took a look at the creation routines of the
ndarray
element. They have a lot of well recognizable list of routines to create arrays based on the features of the array:zeros
,ones
,full
, etc.I know that part of this decision is due to the lack of function override on Python, but for me this raises a new question: Do we need to create different functions to create a new array?
The current solution I see on NuMojo is to only create a
NDArray
by using the struct, but I am worried that this may create additional layers of complexity when navigating through the documentation to look on how to initialize an array in an specific way. Maintenance may be affected as well IMO.I guess this is worth to have a discussion to better understand you point of view.
Beta Was this translation helpful? Give feedback.
All reactions