Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_tensor_operations.jl @ 977:043d13ef8898 feature/tensormapping_application_promotion
Fix type calculation of LazyTensorMappingApplication element type
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 15 Mar 2022 21:03:17 +0100 |
parents | 089a1411dfc0 |
children | df562695b1b5 bc384aaade30 bbbc31953367 |
comparison
equal
deleted
inserted
replaced
976:089a1411dfc0 | 977:043d13ef8898 |
---|---|
10 struct LazyTensorMappingApplication{T,R,D, TM<:TensorMapping{<:Any,R,D}, AA<:AbstractArray{<:Any,D}} <: LazyArray{T,R} | 10 struct LazyTensorMappingApplication{T,R,D, TM<:TensorMapping{<:Any,R,D}, AA<:AbstractArray{<:Any,D}} <: LazyArray{T,R} |
11 t::TM | 11 t::TM |
12 o::AA | 12 o::AA |
13 | 13 |
14 function LazyTensorMappingApplication(t::TensorMapping{<:Any,R,D}, o::AbstractArray{<:Any,D}) where {R,D} | 14 function LazyTensorMappingApplication(t::TensorMapping{<:Any,R,D}, o::AbstractArray{<:Any,D}) where {R,D} |
15 T = promote_type(eltype(t), eltype(o)) | 15 I = ntuple(i->1, range_dim(t)) |
16 T = typeof(apply(t,o,I...)) | |
16 return new{T,R,D,typeof(t), typeof(o)}(t,o) | 17 return new{T,R,D,typeof(t), typeof(o)}(t,o) |
17 end | 18 end |
18 end | 19 end |
19 # TODO: Do boundschecking on creation! | 20 # TODO: Do boundschecking on creation! |
20 | 21 |