Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/LazyTensors.jl @ 1037:9e76bf19904c refactor/lazy_tensors
Drop more prefixes
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 22 Mar 2022 14:10:53 +0100 |
parents | 6abbb2c6c3e4 |
children | 93f87d5d9fbb |
comparison
equal
deleted
inserted
replaced
1017:6abbb2c6c3e4 | 1037:9e76bf19904c |
---|---|
1 module LazyTensors | 1 module LazyTensors |
2 | 2 |
3 export TensorApplication | 3 export TensorApplication |
4 export LazyTensorTranspose | 4 export TensorTranspose |
5 export TensorComposition | 5 export TensorComposition |
6 export DenseTensor | 6 export DenseTensor |
7 export IdentityTensor | 7 export IdentityTensor |
8 export ScalingTensor | 8 export ScalingTensor |
9 export InflatedTensor | 9 export InflatedTensor |
22 Base.:*(a::LazyTensor, v::AbstractArray) = TensorApplication(a,v) | 22 Base.:*(a::LazyTensor, v::AbstractArray) = TensorApplication(a,v) |
23 Base.:*(a::LazyTensor, b::LazyTensor) = throw(MethodError(Base.:*,(a,b))) | 23 Base.:*(a::LazyTensor, b::LazyTensor) = throw(MethodError(Base.:*,(a,b))) |
24 Base.:*(a::LazyTensor, args::Union{LazyTensor, AbstractArray}...) = foldr(*,(a,args...)) | 24 Base.:*(a::LazyTensor, args::Union{LazyTensor, AbstractArray}...) = foldr(*,(a,args...)) |
25 | 25 |
26 # Addition and subtraction of lazy tensors | 26 # Addition and subtraction of lazy tensors |
27 Base.:+(s::LazyTensor, t::LazyTensor) = LazyTensorBinaryOperation{:+}(s,t) | 27 Base.:+(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:+}(s,t) |
28 Base.:-(s::LazyTensor, t::LazyTensor) = LazyTensorBinaryOperation{:-}(s,t) | 28 Base.:-(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:-}(s,t) |
29 | 29 |
30 # Composing lazy tensors | 30 # Composing lazy tensors |
31 Base.:∘(s::LazyTensor, t::LazyTensor) = TensorComposition(s,t) | 31 Base.:∘(s::LazyTensor, t::LazyTensor) = TensorComposition(s,t) |
32 | 32 |
33 # Outer products of tensors | 33 # Outer products of tensors |