changeset 1296:97dfca9ec054 performance/lazy_tensors

Add inference test
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 05 Oct 2022 13:56:21 +0200
parents 87576b0ca0e3
children c33d0d837b4a
files test/LazyTensors/lazy_tensor_operations_test.jl
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/LazyTensors/lazy_tensor_operations_test.jl	Wed Oct 05 13:15:32 2022 +0200
+++ b/test/LazyTensors/lazy_tensor_operations_test.jl	Wed Oct 05 13:56:21 2022 +0200
@@ -189,6 +189,16 @@
     @test range_size(a*Ã) == range_size(Ã)
     @test domain_size(a*Ã) == domain_size(Ã)
     @test a*Ã*v == a.*A*v
+
+    @testset "Inference of application" begin
+        tm = Ã∘B̃
+        v = rand(4)
+
+        @inferred apply(tm,v,1)
+        @inferred apply(tm,v,2)
+        @inferred (tm*v)[1]
+        @inferred (tm*v)[2]
+    end
 end