Mercurial > repos > public > sbplib_julia
changeset 1880:378002c78e86 refactor/lazy_tensors/elementwise_ops
Add implementation of apply_transpose to TensorSum
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 27 Jan 2025 17:11:31 +0100 |
parents | 765f42559c47 |
children | ca3d8a571505 |
files | src/LazyTensors/lazy_tensor_operations.jl |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl Mon Jan 27 17:11:14 2025 +0100 +++ b/src/LazyTensors/lazy_tensor_operations.jl Mon Jan 27 17:11:31 2025 +0100 @@ -106,6 +106,14 @@ return +(vs...) end +function apply_transpose(tmBinOp::TensorSum{T,R,D}, v::AbstractArray{<:Any,D}, I::Vararg{Any,R}) where {T,R,D} + vs = map(tmBinOp.tms) do tm + apply_transpose(tm,v,I...) + end + + return +(vs...) +end + range_size(tmBinOp::TensorSum) = range_size(tmBinOp.tms[1]) domain_size(tmBinOp::TensorSum) = domain_size(tmBinOp.tms[1])