comparison src/LazyTensors/lazy_tensor_operations.jl @ 442:e70e47fbfa7c feature/lazy_identity

Add another convenience constructor
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 19 Oct 2020 21:41:34 +0200
parents 552189707fbe
children ac6d22570a08
comparison
equal deleted inserted replaced
441:552189707fbe 442:e70e47fbfa7c
160 end 160 end
161 export IdentityMapping 161 export IdentityMapping
162 162
163 IdentityMapping{T}(size::NTuple{D,Int}) where {T,D} = IdentityMapping{T,D}(size) 163 IdentityMapping{T}(size::NTuple{D,Int}) where {T,D} = IdentityMapping{T,D}(size)
164 IdentityMapping{T}(size::Vararg{Int,D}) where {T,D} = IdentityMapping{T,D}(size) 164 IdentityMapping{T}(size::Vararg{Int,D}) where {T,D} = IdentityMapping{T,D}(size)
165 IdentityMapping(size::Vararg{Int,D}) where D = IdentityMapping{Float64,D}(size)
165 166
166 range_size(tmi::IdentityMapping) = tmi.size 167 range_size(tmi::IdentityMapping) = tmi.size
167 domain_size(tmi::IdentityMapping) = tmi.size 168 domain_size(tmi::IdentityMapping) = tmi.size
168 169
169 apply(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...] 170 apply(tmi::IdentityMapping{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]