Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/lazy_array.jl @ 1145:4da66d6d7bed refactor/grids
Merge bugfix/lazy_tensors/lazyfunctionarray
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 19 Oct 2022 23:14:00 +0200 |
parents | 6fd97b5ed3e5 |
children | c5cf32fab163 |
comparison
equal
deleted
inserted
replaced
1144:cfe6a09974fb | 1145:4da66d6d7bed |
---|---|
26 size::NTuple{D,Int} | 26 size::NTuple{D,Int} |
27 end | 27 end |
28 export LazyFunctionArray | 28 export LazyFunctionArray |
29 | 29 |
30 function LazyFunctionArray(f::F, size::NTuple{D,Int}) where {F<:Function,D} | 30 function LazyFunctionArray(f::F, size::NTuple{D,Int}) where {F<:Function,D} |
31 T = typeof(f(ones(D)...)) | 31 T = typeof(f(ones(Int, D)...)) |
32 return LazyFunctionArray{F,T,D}(f,size) | 32 return LazyFunctionArray{F,T,D}(f,size) |
33 end | 33 end |
34 | 34 |
35 Base.size(lfa::LazyFunctionArray) = lfa.size | 35 Base.size(lfa::LazyFunctionArray) = lfa.size |
36 | 36 |