Skip to content

Commit 0a5e5b5

Browse files
authored
reduce calls to _comp_size
1 parent 2a19fd9 commit 0a5e5b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/operators_lazytensor.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,10 @@ function _gemm_puresparse(alpha, h::LazyTensor{B1,B2,F,I,T}, op::Matrix, beta, r
664664
end
665665

666666
function _get_shape_and_srtides(h::LazyTensor{B1,B2,F,I,T}) where {B1,B2,F,I,T<:Tuple{Vararg{SparseOpPureType}}}
667-
shape = min.(_comp_size(h.basis_l), _comp_size(h.basis_r))
668-
strides_j = _strides(_comp_size(h.basis_l))
669-
strides_k = _strides(_comp_size(h.basis_r))
670-
shape, strides_j, strides_k
667+
shape_l, shape_r = _comp_size(h.basis_l), _comp_size(h.basis_r)
668+
shape = min.(shape_l, shape_r)
669+
strides_j, strides_k = _strides(shape_l), _strides(shape_r)
670+
return shape, strides_j, strides_k
671671
end
672672

673673
_mul_puresparse!(result::DenseOpType{B1,B3},h::LazyTensor{B1,B2,F,I,T},op::DenseOpType{B2,B3},alpha,beta) where {B1,B2,B3,F,I,T<:Tuple{Vararg{SparseOpPureType}}} = (_gemm_puresparse(alpha, h, op.data, beta, result.data); result)

0 commit comments

Comments
 (0)