Introduction
Indexing and slicing help you pick parts of data from tensors easily, like choosing pieces from a big cake.
When you want to get a single value from a tensor.
When you need a smaller part of a tensor for calculations.
When you want to change some values inside a tensor.
When you want to loop over parts of data in a tensor.
When you want to prepare data batches for training a model.