changeset 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 1d6250fcf14c
files src/LazyTensors/lazy_tensor_operations.jl
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl	Sun Oct 18 22:30:17 2020 +0200
+++ b/src/LazyTensors/lazy_tensor_operations.jl	Mon Oct 19 09:18:38 2020 +0200
@@ -159,6 +159,6 @@
 range_size(tmi::LazyIdentity) = tmi.size
 domain_size(tmi::LazyIdentity) = tmi.size
 
-apply(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Index,D}) where {T,D} = v[Int.(I)...]
-apply_transpose(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Index,D}) where {T,D} = v[Int.(I)...]
+apply(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]
+apply_transpose(tmi::LazyIdentity{T,D}, v::AbstractArray{T,D}, I::Vararg{Any,D}) where {T,D} = v[I...]