Skip to content

Commit

Permalink
Fix catenation for >= 3d arrays (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu authored Jan 7, 2025
1 parent 4cd910e commit b85542d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions testdata/binary_matrix.ivy
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ x = (2 3 rho iota 10); y=x; y[1;1]=0; x===x; x!==x; x===y; x!==y
7 8 9 33
10 11 12 44

(2 2 3 rho iota 12) , 10*(2 2 3 rho iota 12)
1 2 3 10 20 30
4 5 6 40 50 60

7 8 9 70 80 90
10 11 12 100 110 120

(2 2 3 rho iota 12) ,% 11*(2 3 rho iota 10)
1 2 3
4 5 6
Expand Down
2 changes: 1 addition & 1 deletion value/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func (x *Matrix) catenate(y *Matrix) *Matrix {
// list, list
setShape(x, y.shape[len(y.shape)-1])
data = make([]Value, x.data.Len()+y.data.Len())
xsize, ysize := x.ElemSize(), y.ElemSize()
xsize, ysize := x.shape[len(x.shape)-1], y.shape[len(y.shape)-1]
copyElems(xsize, xsize, ysize, ysize)

case x.Rank() == y.Rank()+1 && sameShape(x.shape[:len(x.shape)-1], y.shape):
Expand Down

0 comments on commit b85542d

Please sign in to comment.