Learn Before
Concept

Programmatic Construction of Tensors from Nested Lists

Tensors can be constructed explicitly by supplying the exact numerical literals for every element using nested Python lists. The hierarchical depth of the nested lists corresponds to the axes of the resulting tensor. For example, to construct a matrix, a list of lists is provided where the outermost list defines axis 00 (the rows) and each inner list defines axis 11 (the columns).

0

1

Updated 2026-05-01

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L