deep-learning-with-python-notebooks icon indicating copy to clipboard operation
deep-learning-with-python-notebooks copied to clipboard

Chaper 2: Tensor product terminology used incorrectly

Open omaclaren opened this issue 1 month ago • 0 comments

The text says:

Tensor product
The tensor product, also called dot product or matmul (short for “matrix multiplication”) is one of the most common, most useful tensor operations.

In NumPy, a tensor product is done using the np.matmul function, and in Keras, with the keras.ops.matmul function. Its shorthand is the @ operator in Python:

This incorrectly identifies "tensor product" with "dot product" and "matmul". These are distinct operations:

  • Matrix multiplication/dot product/contraction (np.matmul, @): Contract/sum over indices, giving result no bigger than inputs

  • Tensor/outer product (np.outer, np.kron): Preserve all indices, increase dimensionality relative to each input

Suggested correction: Replace "tensor product" with "tensor contraction" or, more informally but still better, "tensor multiplication".

omaclaren avatar Nov 07 '25 01:11 omaclaren