diff src/LazyTensors/lazy_array.jl @ 1003:7ef605b8f132 refactor/lazy_tensors

Remove a bunch of todos
author Jonatan Werpers <jonatan@werpers.com>
date Sun, 20 Mar 2022 21:19:00 +0100
parents 76e5682d0e52
children 7fd37aab84fe
line wrap: on
line diff
--- a/src/LazyTensors/lazy_array.jl	Fri Mar 18 22:18:04 2022 +0100
+++ b/src/LazyTensors/lazy_array.jl	Sun Mar 20 21:19:00 2022 +0100
@@ -61,7 +61,6 @@
 end
 LazyElementwiseOperation{T,D,Op}(a::AbstractArray{T,D},b::T) where {T,D,Op} = LazyElementwiseOperation{T,D,Op}(a, LazyConstantArray(b, size(a)))
 LazyElementwiseOperation{T,D,Op}(a::T,b::AbstractArray{T,D}) where {T,D,Op} = LazyElementwiseOperation{T,D,Op}(LazyConstantArray(a,  size(b)), b)
-# TODO: Move Op to be the first parameter? Compare to Binary operations
 
 Base.size(v::LazyElementwiseOperation) = size(v.a)
 
@@ -70,11 +69,6 @@
 evaluate(leo::LazyElementwiseOperation{T,D,:*}, I::Vararg{Int,D}) where {T,D} = leo.a[I...] * leo.b[I...]
 evaluate(leo::LazyElementwiseOperation{T,D,:/}, I::Vararg{Int,D}) where {T,D} = leo.a[I...] / leo.b[I...]
 
-# TODO: Make sure boundschecking is done properly and that the lenght of the vectors are equal
-# NOTE: Boundschecking in getindex functions now assumes that the size of the
-# vectors in the LazyElementwiseOperation are the same size. If we remove the
-# size assertion in the constructor we might have to handle
-# boundschecking differently.
 Base.@propagate_inbounds @inline function Base.getindex(leo::LazyElementwiseOperation{T,D}, I::Vararg{Int,D}) where {T,D}
     @boundscheck if !checkbounds(Bool, leo.a, I...)
         throw(BoundsError([leo], I...))