ndarray 1D matrix multiplication #397
derppening
commented 2024-04-23 10:31:12 +08:00
Collaborator
> The behavior depends on the arguments in the following way.
>
> ...
>
> - If the first argument is 1-D, it is promoted to a matrix by prepending a 1 to its dimensions. After matrix multiplication the prepended 1 is removed.
>
> - If the second argument is 1-D, it is promoted to a matrix by appending a 1 to its dimensions. After matrix multiplication the appended 1 is removed.
```py
>>> np.identity(2) @ np.zeros((2))
array([0., 0.])
>>> np.zeros((2)) @ np.identity(2)
array([0., 0.])
>>> np.zeros((2)) @ np.zeros(2)
0.0
```
derppening
referenced this issue 2024-04-23 10:31:31 +08:00
ndarray: Implement 2D-2D matrix multiplication #398
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#397
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?