Learn Before
Concept

Programmatic Representation of Matrices

In deep learning frameworks, a mathematical matrix ARm×n\mathbf{A} \in \mathbb{R}^{m \times n} is programmatically implemented as a 2nd2^{\textrm{nd}}-order tensor possessing a shape of (m,n)(m, n). You can dynamically construct a matrix from an existing appropriately sized tensor by utilizing the reshape function (e.g., .reshape(m, n)). This operation reorganizes the sequential data into the specified row and column dimensions, allowing a generic one-dimensional tensor of m×nm \times n elements to be explicitly cast into a valid m×nm \times n matrix structure without altering the underlying numerical values.

0

1

Updated 2026-05-02

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L