comparison src/LazyTensors/LazyTensors.jl @ 1000:1091ac8c69ad refactor/lazy_tensors

Rename another struct
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 18 Mar 2022 21:54:01 +0100
parents 20cb83efb3f1
children a3df203861d3
comparison
equal deleted inserted replaced
999:20cb83efb3f1 1000:1091ac8c69ad
20 Base.:*(a::LazyTensor, v::AbstractArray) = LazyTensorApplication(a,v) 20 Base.:*(a::LazyTensor, v::AbstractArray) = LazyTensorApplication(a,v)
21 Base.:*(a::LazyTensor, b::LazyTensor) = throw(MethodError(Base.:*,(a,b))) 21 Base.:*(a::LazyTensor, b::LazyTensor) = throw(MethodError(Base.:*,(a,b)))
22 Base.:*(a::LazyTensor, args::Union{LazyTensor, AbstractArray}...) = foldr(*,(a,args...)) 22 Base.:*(a::LazyTensor, args::Union{LazyTensor, AbstractArray}...) = foldr(*,(a,args...))
23 23
24 # Addition and subtraction of lazy tensors 24 # Addition and subtraction of lazy tensors
25 Base.:+(tm1::LazyTensor{T,R,D}, tm2::LazyTensor{T,R,D}) where {T,R,D} = LazyLazyTensorBinaryOperation{:+,T,R,D}(tm1,tm2) 25 Base.:+(tm1::LazyTensor{T,R,D}, tm2::LazyTensor{T,R,D}) where {T,R,D} = LazyTensorBinaryOperation{:+,T,R,D}(tm1,tm2)
26 Base.:-(tm1::LazyTensor{T,R,D}, tm2::LazyTensor{T,R,D}) where {T,R,D} = LazyLazyTensorBinaryOperation{:-,T,R,D}(tm1,tm2) 26 Base.:-(tm1::LazyTensor{T,R,D}, tm2::LazyTensor{T,R,D}) where {T,R,D} = LazyTensorBinaryOperation{:-,T,R,D}(tm1,tm2)
27 27
28 # Composing lazy tensors 28 # Composing lazy tensors
29 Base.:∘(s::LazyTensor, t::LazyTensor) = LazyTensorComposition(s,t) 29 Base.:∘(s::LazyTensor, t::LazyTensor) = LazyTensorComposition(s,t)
30 30
31 # Outer products of tensors 31 # Outer products of tensors