Open mli42 opened 1 year ago
There is a commentary for the __mul__ method that says returns a Vector if we perform Matrix * Vector multiplication
__mul__
returns a Vector if we perform Matrix * Vector multiplication
But in the examples, there is the choice between Matrix and Vector:
m1 * v1 # Output: Matrix([[8], [16]]) # Or: Vector([[8], [16]
(Also the last line has ]) missing)
])
But there is an exception, if we multiply a Matrix of shape (3, 1) with a Vector of shape (1, 2), we should obtain a Matrix of shape (3, 2) and not a Vector. We might want a row vector or a colomn vector when possible, but definitly not every time.
(3, 1)
(1, 2)
(3, 2)
There is a commentary for the
__mul__
method that saysreturns a Vector if we perform Matrix * Vector multiplication
But in the examples, there is the choice between Matrix and Vector:
(Also the last line has
])
missing)But there is an exception, if we multiply a Matrix of shape
(3, 1)
with a Vector of shape(1, 2)
, we should obtain a Matrix of shape(3, 2)
and not a Vector. We might want a row vector or a colomn vector when possible, but definitly not every time.Fixed on: