Learn Before
Concept
Default Axis for Tensor Indexing
When a single index or slice is provided for a -order tensor (where ), the selection operation defaults to being applied along axis . For example, applying the index [-1] to a matrix returns its last row, while the slice [1:3] returns its second and third rows.
0
1
Updated 2026-05-01
Tags
D2L
Dive into Deep Learning @ D2L