comparison test/LazyTensors/lazy_tensor_operations_test.jl @ 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 2e606d4c0ab1
children
comparison
equal deleted inserted replaced
1295:87576b0ca0e3 1296:97dfca9ec054
187 @test a*Ã isa TensorComposition 187 @test a*Ã isa TensorComposition
188 @test a*Ã == Ã*a 188 @test a*Ã == Ã*a
189 @test range_size(a*Ã) == range_size(Ã) 189 @test range_size(a*Ã) == range_size(Ã)
190 @test domain_size(a*Ã) == domain_size(Ã) 190 @test domain_size(a*Ã) == domain_size(Ã)
191 @test a*Ã*v == a.*A*v 191 @test a*Ã*v == a.*A*v
192
193 @testset "Inference of application" begin
194 tm = Ã∘B̃
195 v = rand(4)
196
197 @inferred apply(tm,v,1)
198 @inferred apply(tm,v,2)
199 @inferred (tm*v)[1]
200 @inferred (tm*v)[2]
201 end
192 end 202 end
193 203
194 204
195 @testset "InflatedTensor" begin 205 @testset "InflatedTensor" begin
196 I(sz...) = IdentityTensor(sz...) 206 I(sz...) = IdentityTensor(sz...)