Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_tensor_operations.jl @ 957:86889fc5b63f feature/tensormapping_application_promotion
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 14 Mar 2022 08:48:02 +0100 |
parents | 4a4ef4bf6cb9 6a2e30fa3bd8 |
children | e79debd10f7d 089a1411dfc0 |
comparison
equal
deleted
inserted
replaced
946:469ed954b493 | 957:86889fc5b63f |
---|---|
27 end | 27 end |
28 end | 28 end |
29 # TODO: Do boundschecking on creation! | 29 # TODO: Do boundschecking on creation! |
30 | 30 |
31 Base.getindex(ta::LazyTensorMappingApplication{T,R}, I::Vararg{Any,R}) where {T,R} = apply(ta.t, ta.o, I...) | 31 Base.getindex(ta::LazyTensorMappingApplication{T,R}, I::Vararg{Any,R}) where {T,R} = apply(ta.t, ta.o, I...) |
32 Base.getindex(ta::LazyTensorMappingApplication{T,1}, I::CartesianIndex{1}) where {T} = apply(ta.t, ta.o, I.I...) # Would otherwise be caught in the previous method. | |
32 Base.size(ta::LazyTensorMappingApplication) = range_size(ta.t) | 33 Base.size(ta::LazyTensorMappingApplication) = range_size(ta.t) |
33 # TODO: What else is needed to implement the AbstractArray interface? | 34 # TODO: What else is needed to implement the AbstractArray interface? |
34 | 35 |
35 Base.:*(a::TensorMapping, v::AbstractArray) = LazyTensorMappingApplication(a,v) | 36 Base.:*(a::TensorMapping, v::AbstractArray) = LazyTensorMappingApplication(a,v) |
36 Base.:*(a::TensorMapping, b::TensorMapping) = throw(MethodError(Base.:*,(a,b))) | 37 Base.:*(a::TensorMapping, b::TensorMapping) = throw(MethodError(Base.:*,(a,b))) |