I'm currently reading "Deep Learning with Python, Second Edition" by François Chollet, and I need help understanding one thing.

Below paragraph was copied from the page 41

2.2.3 Tensor product

The tensor product, or dot product (not to be confused with an element-wise product, the * operator), is one of the most common, most useful tensor operations. In NumPy, a tensor product is done using the np.dot function (because the mathematical notation for tensor product is usually a dot)

What has been described later in that section looks like a dot product to me (I don't have mathematical background though, I've just recently taken an interest in the subject), but this term also seems to be used interchangeably with "Tensor product".

However, according to every other source I've came across - dot product and tensor product are two different things (example: wikipedia article on dot product and wikipedia article on tensor product).

Is this an error in the book or am I missing something obvious here?


1 Answer 1


In machine learning, a tensor is a multidimensional array with some operations. In mathematics, the definition of a tensor is slightly different (see the Wikipedia article). However, the definitions are related because mathematical tensors can be represented as multidimensional arrays. See e.g. this post.

In this book, the tensor product is defined as the numpy operation np.dot, which can perform the mathematical dot product (aka inner product), matrix multiplication, etc., depending on the dimensionality of the inputs.

So, in conclusion, terms are overloaded and can vary across disciplines and you should always take the context into account.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .