Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A tensor of rank two is the same thing as a matrix…


It isn't.

Matrices come with the matrix product defined over them.

This is one of four possible closed first order tensor contractions for an order two tensor, viz. AijBik AijBki AijBjk AijBkj. Only the third is applicable to matrices, all other contractions only work for general tensors without transposition.

What we deal with in computer science are actually n dimensional arrays since we don't have the co and contravariant indices that define tensors in physics.


I think we are talking past each other.

The thing described by the article can be summarized by: "Any time you see A x B, you replace it with A x B^T" and it would, in practice, be exactly the same. I'm not sure the author understood this because then then go on to do a bunch of performance checks to see if there is any difference between the two. Which there isn't, because under the hood it is the exact same operations. They just multiple columns into columns (or rows into rows) instead of rows into columns. But the implicit transpose would undo that.

You can note (correctly) that this doesn't line up with the precise, but arbitrary traditional definition of a matrix, and that is correct. But that is just word games because you can very simply, using only syntax and no calculations, transform one into the other.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: