# Matrix multiplication - inconsistent behaviour

**URL:** <https://discourse.julialang.org/t/matrix-multiplication-inconsistent-behaviour/36640>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 28, 2020, 2:41pm UTC](https://discourse.julialang.org/t/matrix-multiplication-inconsistent-behaviour/36640 "2020-03-28T14:41:34Z")\
**Posts on this page:** 1\
**Showing post:** 36

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [May 14, 2020, 9:10pm UTC](https://discourse.julialang.org/t/matrix-multiplication-inconsistent-behaviour/36640/36 "2020-05-14T21:10:44Z")

</div>

This thread remembers me of [this discussion I had](https://discourse.julialang.org/t/eachrow-over-array-any-2-does-not-return-rows-why/34601/22). Summarizing: `eachrow` returns a `Vector` that is a column, not a row, because dimensions are dropped.

I remember after finding a thread of the Julia founders (I think a issue in the Julia Language Github) where they decided to start dropping dimensions (this was not always the Julia language behavior). I do not remember the exact reasoning anymore, but I remember to think ‘hmm, there is much else involved that I did not think of, for many problems dropping the dimensions is the most elegant/seamless decision’. That said, I think in some cases the code is much more annoying to write because of this behavior. As others said, this kind of type piracy (not all type piracy) is considerable dangerous. However, instead of “ajusting” I would recommend you to consider if it is worth creating a new `Array` type (a subtype of `AbstractArray`) that does not possess such behaviour (never drops dimensions), use it in your code, and see if for some cases it is better to work with. It could make an interesting package. We have packages for vectors starting in random/arbitrary offsets, why not arrays that do not drop dimensions when they become unitary.

---

_[View the full topic](https://discourse.julialang.org/t/matrix-multiplication-inconsistent-behaviour/36640)._
