Mercurial > repos > public > sbplib_julia
diff src/LazyTensors/tensor_mapping.jl @ 988:83046af6143a
Merge feature/tensormapping_application_promotion
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 16 Mar 2022 18:39:00 +0100 |
parents | 1f41cf9454f2 |
children | 1ba8a398af9c |
line wrap: on
line diff
--- a/src/LazyTensors/tensor_mapping.jl Wed Mar 16 18:32:59 2022 +0100 +++ b/src/LazyTensors/tensor_mapping.jl Wed Mar 16 18:39:00 2022 +0100 @@ -1,10 +1,16 @@ +export TensorMapping +export apply +export apply_transpose +export range_dim, domain_dim +export range_size, domain_size + """ TensorMapping{T,R,D} Describes a mapping of a `D` dimension tensor to an `R` dimension tensor. The action of the mapping is implemented through the method ```julia - apply(t::TensorMapping{T,R,D}, v::AbstractArray{T,D}, I::Vararg) where {R,D,T} + apply(t::TensorMapping{T,R,D}, v::AbstractArray{<:Any,D}, I::Vararg) where {R,D,T} ``` The size of the range and domain that the operator works with should be returned by @@ -21,23 +27,20 @@ ``` """ abstract type TensorMapping{T,R,D} end -export TensorMapping """ - apply(t::TensorMapping{T,R,D}, v::AbstractArray{T,D}, I::Vararg) where {R,D,T} + apply(t::TensorMapping{T,R,D}, v::AbstractArray{<:Any,D}, I::Vararg) where {R,D,T} Return the result of the mapping for a given index. """ function apply end -export apply """ - apply_transpose(t::TensorMapping{T,R,D}, v::AbstractArray{T,R}, I::Vararg) where {R,D,T} + apply_transpose(t::TensorMapping{T,R,D}, v::AbstractArray{<:Any,R}, I::Vararg) where {R,D,T} Return the result of the transposed mapping for a given index. """ function apply_transpose end -export apply_transpose """ range_dim(::TensorMapping) @@ -51,7 +54,6 @@ """ domain_dim(::TensorMapping{T,R,D}) where {T,R,D} = D -export range_dim, domain_dim """ range_size(M::TensorMapping) @@ -67,7 +69,6 @@ """ function domain_size end -export range_size, domain_size """ eltype(::TensorMapping{T})