Mercurial > repos > public > sbplib_julia
changeset 2086:53e5887457b9
Merge bugfix/lazy_tensors/tensor_sum_inference
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Mon, 02 Mar 2026 13:51:56 +0100 |
| parents | 118c09b168f5 (current diff) be972af59d06 (diff) |
| children | ebf0c1686eba 17a41f0eddb0 |
| files | |
| diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl Wed Feb 18 21:33:00 2026 +0100 +++ b/src/LazyTensors/lazy_tensor_operations.jl Mon Mar 02 13:51:56 2026 +0100 @@ -99,15 +99,19 @@ end function apply(tmBinOp::TensorSum{T,R,D}, v::AbstractArray{<:Any,D}, I::Vararg{Any,R}) where {T,R,D} - return sum(tmBinOp.tms) do tm + vs = map(tmBinOp.tms) do tm apply(tm,v,I...) end + + return +(vs...) end function apply_transpose(tmBinOp::TensorSum{T,R,D}, v::AbstractArray{<:Any,D}, I::Vararg{Any,R}) where {T,R,D} - return sum(tmBinOp.tms) do tm + vs = map(tmBinOp.tms) do tm apply_transpose(tm,v,I...) end + + return +(vs...) end range_size(tmBinOp::TensorSum) = range_size(tmBinOp.tms[1])
