Learn Before
Code
Programmatic Matrix-Vector Product
In deep learning frameworks, the matrix-vector product of a matrix A and a vector x can be computed using built-in functions, provided the column dimension of A strictly matches the length of x. In PyTorch, this is executed using torch.mv(A, x) or the Python matrix multiplication operator via A @ x. For MXNet, the operation is inferred based on argument shapes using np.dot(A, x). JAX performs this calculation with jnp.matmul(A, x), whereas TensorFlow provides the specialized function tf.linalg.matvec(A, x).
0
1
Updated 2026-05-01
Tags
D2L
Dive into Deep Learning @ D2L