Skip to content

Chaper 2: Tensor product terminology used incorrectly #264

@omaclaren

Description

@omaclaren

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions