[Feature Request] Slice tensors using "standard" indexing #2638
Labels
enhancement
New feature or request
mojo-python-interop
mojo-repo
Tag all issues with this label
mojo-stdlib
Tag for issues related to standard library
Review Mojo's priorities
What is your request?
Slicing tensors to assign new variables is not intuitive right now. Both Golang and Python use the same indexing and another modern language like Mojo should as well, especially if the aim is to lower the barrier to entry for new users.
What is your motivation for this change?
Following the examples and documentation I see syntax that is very nearly Python and I would expect the
Tensor
type to behave like tensors in Python as well.Any other details?
A first cut could be a middle ground between what's possible now and how Golang and Python achieve this where the user still has to preallocate the memory but is able to assign using slice indices
A logical next iteration might relieve the user of having to call
Index
The holy grail would be something akin to Python's default behavior, Golang's
:=
, and C++'sauto
where the memory allocation is handled on the fly.The text was updated successfully, but these errors were encountered: