Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/LazyTensors.jl @ 1300:a922aa69eb83 bugfix/lazy_tensors/tensorcomposition
Fix type inference of nested tensorcompositions by making the compositions right associative
| author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
|---|---|
| date | Wed, 26 Apr 2023 21:56:45 +0200 |
| parents | 93f87d5d9fbb |
| children | dfb43fdac9fc 8b64df6cadba |
comparison
equal
deleted
inserted
replaced
| 1240:a9ac86f6be8a | 1300:a922aa69eb83 |
|---|---|
| 28 Base.:+(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:+}(s,t) | 28 Base.:+(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:+}(s,t) |
| 29 Base.:-(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:-}(s,t) | 29 Base.:-(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:-}(s,t) |
| 30 | 30 |
| 31 # Composing lazy tensors | 31 # Composing lazy tensors |
| 32 Base.:∘(s::LazyTensor, t::LazyTensor) = TensorComposition(s,t) | 32 Base.:∘(s::LazyTensor, t::LazyTensor) = TensorComposition(s,t) |
| 33 Base.:∘(s::TensorComposition, t::LazyTensor) = s.t1∘(s.t2∘t) | |
| 33 | 34 |
| 34 # Outer products of tensors | 35 # Outer products of tensors |
| 35 ⊗(a::LazyTensor, b::LazyTensor) = LazyOuterProduct(a,b) | 36 ⊗(a::LazyTensor, b::LazyTensor) = LazyOuterProduct(a,b) |
| 36 | 37 |
| 37 end # module | 38 end # module |
