Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_tensor_operations.jl @ 418:264af2bb646f feature/tensor_composition
Switch to using * instead of calling the constructor
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 16 Oct 2020 20:35:41 +0200 |
parents | 4c6604b7d990 |
children | 2958b4ebd565 |
comparison
equal
deleted
inserted
replaced
417:4c6604b7d990 | 418:264af2bb646f |
---|---|
95 | 95 |
96 range_size(tm::TensorMappingComposition) = range_size(tm.t1) | 96 range_size(tm::TensorMappingComposition) = range_size(tm.t1) |
97 domain_size(tm::TensorMappingComposition) = domain_size(tm.t2) | 97 domain_size(tm::TensorMappingComposition) = domain_size(tm.t2) |
98 | 98 |
99 function apply(c::TensorMappingComposition{T,R,K,D}, v::AbstractArray{T,D}, I::Vararg{S,R} where S) where {T,R,K,D} | 99 function apply(c::TensorMappingComposition{T,R,K,D}, v::AbstractArray{T,D}, I::Vararg{S,R} where S) where {T,R,K,D} |
100 apply(c.t1, LazyTensorMappingApplication(c.t2,v), I...) | 100 apply(c.t1, c.t2*v, I...) |
101 end | 101 end |
102 | 102 |
103 function apply_transpose(c::TensorMappingComposition{T,R,K,D}, v::AbstractArray{T,R}, I::Vararg{S,D} where S) where {T,R,K,D} | 103 function apply_transpose(c::TensorMappingComposition{T,R,K,D}, v::AbstractArray{T,R}, I::Vararg{S,D} where S) where {T,R,K,D} |
104 apply_transpose(c.t2, LazyTensorMappingApplication(c.t1',v), I...) | 104 apply_transpose(c.t2, c.t1'*v, I...) |
105 end | 105 end |
106 | 106 |
107 Base.@propagate_inbounds Base.:∘(s::TensorMapping, t::TensorMapping) = TensorMappingComposition(s,t) | 107 Base.@propagate_inbounds Base.:∘(s::TensorMapping, t::TensorMapping) = TensorMappingComposition(s,t) |
108 | 108 |
109 """ | 109 """ |