Skip to content

Commit e79b122

Browse files
committed
size for MPSMatrix
1 parent 6948fdf commit e79b122

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/mps/matrix.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ function MPSMatrix(arr::MtlArray{T,3}) where T
119119
return MPSMatrix(arr, desc, offset)
120120
end
121121

122+
function Base.size(mat::MPS.MPSMatrix)
123+
if mat.matrices > 1
124+
return Int64.((mat.rows, mat.columns, mat.matrices))
125+
else
126+
return Int64.((mat.rows, mat.columns))
127+
end
128+
end
122129

123130
## matrix multiplication
124131

0 commit comments

Comments
 (0)