Mercurial > repos > public > sbplib_julia
view src/LazyTensors/LazyTensors.jl @ 1489:7753fa972c74 update/julia_1.10
Update docs manifest to julia 1.10 and fix issues in make docs
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 29 Dec 2023 01:06:54 +0100 |
parents | a922aa69eb83 |
children | dfb43fdac9fc 8b64df6cadba |
line wrap: on
line source
module LazyTensors export TensorApplication export TensorTranspose export TensorComposition export IdentityTensor export ScalingTensor export DiagonalTensor export DenseTensor export InflatedTensor export LazyOuterProduct export ⊗ export DomainSizeMismatch export RangeSizeMismatch include("lazy_tensor.jl") include("tensor_types.jl") include("lazy_array.jl") include("lazy_tensor_operations.jl") include("tuple_manipulation.jl") # Applying lazy tensors to vectors Base.:*(a::LazyTensor, v::AbstractArray) = TensorApplication(a,v) Base.:*(a::LazyTensor, b::LazyTensor) = throw(MethodError(Base.:*,(a,b))) Base.:*(a::LazyTensor, args::Union{LazyTensor, AbstractArray}...) = foldr(*,(a,args...)) # Addition and subtraction of lazy tensors Base.:+(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:+}(s,t) Base.:-(s::LazyTensor, t::LazyTensor) = ElementwiseTensorOperation{:-}(s,t) # Composing lazy tensors Base.:∘(s::LazyTensor, t::LazyTensor) = TensorComposition(s,t) Base.:∘(s::TensorComposition, t::LazyTensor) = s.t1∘(s.t2∘t) # Outer products of tensors ⊗(a::LazyTensor, b::LazyTensor) = LazyOuterProduct(a,b) end # module