diff LazyTensors/test/runtests.jl @ 325:41c3c25e4e3b

LazyTensors: Simplify the LazyElementwiseOperation type by restricting it and introducing a LazyConstantArray to handle scalars.
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 24 Sep 2020 22:31:04 +0200
parents 277dff5b071a
children
line wrap: on
line diff
--- a/LazyTensors/test/runtests.jl	Thu Sep 24 21:28:28 2020 +0200
+++ b/LazyTensors/test/runtests.jl	Thu Sep 24 22:31:04 2020 +0200
@@ -115,6 +115,15 @@
 end
 
 @testset "LazyArray" begin
+	@testset "LazyConstantArray" begin
+	    @test LazyTensors.LazyConstantArray(3,(3,2)) isa LazyArray{Int,2}
+
+	    lca = LazyTensors.LazyConstantArray(3.0,(3,2))
+	    @test eltype(lca) == Float64
+	    @test ndims(lca) == 2
+	    @test size(lca) == (3,2)
+	    @test lca[2] == 3.0
+	end
     struct DummyArray{T,D, T1<:AbstractArray{T,D}} <: LazyArray{T,D}
         data::T1
     end