Re:PyTorch: Where we are headed and why it looks a lot like ...
by ChrisRackauckas on Saturday November 27, 2021 @08:11AM
(#29359892)
> Zero based indexing makes zero sense
The sensibility of the index choice is equal to the starting value of the index.
Re:PyTorch: Where we are headed and why it looks a lot like ...
by jonniedie on Saturday November 27, 2021 @12:06PM
(#29361591)
StarWars indexing makes 4 sense.
Re:PyTorch: Where we are headed and why it looks a lot like ...
by ChrisRackauckas on Saturday November 27, 2021 @01:37PM
(#29362304)
yupyupyup, you got it. :)
Re:PyTorch: Where we are headed and why it looks a lot like ...
by hpcjoe on Saturday November 27, 2021 @04:08PM
(#29363520)
Precisely. Indexing makes sense in a context, and it is trivial in general to switch. This said, telling people that the first element they want is the "0th", is completely unnatural.
It makes sense in certain context (and in languages like C that have a low-level mental model). For scientific computing at a higher level of abstraction where the mental model of a multidimensional array is a tensor, and not a memory offset location, zero-based indices really get in the way