Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_tensor_operations.jl @ 430:541c16a8c791 feature/lazy_identity
Improve indexing for apply methods
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 19 Oct 2020 09:18:38 +0200 |
parents | 46acb2560451 |
children | 7327a3e41df0 |
comparison
equal
deleted
inserted
replaced
429:46acb2560451 | 430:541c16a8c791 |
---|---|
157 LazyIdentity{T}(size::NTuple{D,Int}) where {T,D} = LazyIdentity{T,D}(size) | 157 LazyIdentity{T}(size::NTuple{D,Int}) where {T,D} = LazyIdentity{T,D}(size) |
158 | 158 |
159 range_size(tmi::LazyIdentity) = tmi.size | 159 range_size(tmi::LazyIdentity) = tmi.size |
160 domain_size(tmi::LazyIdentity) = tmi.size | 160 domain_size(tmi::LazyIdentity) = tmi.size |
161 | 161 |
162 apply(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Index,D}) where {T,D} = v[Int.(I)...] | 162 apply(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...] |
163 apply_transpose(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Index,D}) where {T,D} = v[Int.(I)...] | 163 apply_transpose(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...] |
164 | 164 |